The branch, v3-6-test has been updated via 64e7b7b s3: Filter out duplicates in name_query() from c468946 s3-includes: when MADVISE support was reverted back in 2009, someone forgot this hunk.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log ----------------------------------------------------------------- commit 64e7b7bf09940ab67a0beb5d770849f8bf9336e3 Author: Volker Lendecke <v...@samba.org> Date: Tue May 3 21:28:37 2011 +0200 s3: Filter out duplicates in name_query() Autobuild-User: Volker Lendecke <vlen...@samba.org> Autobuild-Date: Wed May 4 00:03:47 CEST 2011 on sn-devel-104 (cherry picked from commit 7febcb5ffeb2d92f2a4f8abe2c0dac91f5c8a53e) ----------------------------------------------------------------------- Summary of changes: source3/libsmb/namequery.c | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 6d8f158..c36773b 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1330,14 +1330,30 @@ static bool name_query_validator(struct packet_struct *p, void *private_data) for (i=0; i<nmb->answers->rdlength/6; i++) { uint16_t flags; struct in_addr ip; + struct sockaddr_storage addr; + int j; flags = RSVAL(&nmb->answers->rdata[i*6], 0); got_unique_netbios_name |= ((flags & 0x8000) == 0); putip((char *)&ip,&nmb->answers->rdata[2+i*6]); - in_addr_to_sockaddr_storage( - &state->addrs[state->num_addrs], ip); + in_addr_to_sockaddr_storage(&addr, ip); + + for (j=0; j<state->num_addrs; j++) { + if (sockaddr_equal( + (struct sockaddr *)&addr, + (struct sockaddr *)&state->addrs[j])) { + break; + } + } + if (j < state->num_addrs) { + /* Already got it */ + continue; + } + DEBUGADD(2,("%s ",inet_ntoa(ip))); + + state->addrs[state->num_addrs] = addr; state->num_addrs += 1; } DEBUGADD(2,(")\n")); -- Samba Shared Repository