From b83223476c7b6b9aea4efe01d923f009a09cd7d0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 30 Apr 2011 10:14:54 +0200 Subject: s4:torture/nbt/winsreplication: ignore incoming broadcast messages This will hopefully fix the flakey behavior of the samba4.nbt.winsreplication.owned test. metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Sat Apr 30 12:45:01 CEST 2011 on sn-devel-104 --- source4/torture/nbt/winsreplication.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 071c19f6f0..e30bfdd852 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9764,6 +9764,17 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket { struct test_conflict_owned_active_vs_replica_struct *rec = (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data; + struct nbt_name *name = &req_packet->questions[0].name; + + if (req_packet->operation & NBT_FLAG_BROADCAST) { + torture_comment(rec->tctx, + "%s: incoming packet name[%s] flags[0x%08X] from[%s]\n", + __location__, + nbt_name_string(rec->tctx, name), + req_packet->operation, + src->addr); + return; + } rec->defend.ret = false; @@ -9775,8 +9786,14 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src); break; default: - printf("%s: unexpected incoming packet\n", __location__); - return; + torture_comment(rec->tctx, + "%s: unexpected packet name[%s] flags[0x%08X] from[%s]\n", + __location__, + nbt_name_string(rec->tctx, name), + req_packet->operation, + src->addr); + _NBT_ASSERT((req_packet->operation & NBT_OPCODE), NBT_OPCODE_QUERY); + break; } } -- cgit