diff options
author | Jeremy Allison <jra@samba.org> | 1997-12-16 07:30:25 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1997-12-16 07:30:25 +0000 |
commit | 5d4345b66de2bbf9d60e78682d820adb30b52a79 (patch) | |
tree | c63ee54a374d9ad3c485cadd1fc7197dd84617c1 /source3/nmbd/nmbd_incomingrequests.c | |
parent | 95d600a3521ef97cad9852a09e534c0c7ae8a8d7 (diff) | |
download | samba-5d4345b66de2bbf9d60e78682d820adb30b52a79.tar.gz samba-5d4345b66de2bbf9d60e78682d820adb30b52a79.tar.bz2 samba-5d4345b66de2bbf9d60e78682d820adb30b52a79.zip |
nmbd_incomingdgrams.c: Fix bug with Syntax 5.1 servers reported by SGI where
they do host announcements to LOCAL_MASTER_BROWSER_NAME<00> rather than
WORKGROUP<1d>.
nmbd_incomingrequests.c: Deal with WINS_PROXY_NAME issues - don't reply
with that name if it's the same broadcast net.
nmbd_serverlistdb.c: Stopped writing "Unknown" for local master browsers
we don't know.
nmbd_winsproxy.c: Deal with WINS_PROXY_NAME issues - don't reply
with that name if it's the same broadcast net.
Jeremy.
(This used to be commit 5adfff94c9020bd57f84ccbc8fba5b1d8d1615af)
Diffstat (limited to 'source3/nmbd/nmbd_incomingrequests.c')
-rw-r--r-- | source3/nmbd/nmbd_incomingrequests.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/source3/nmbd/nmbd_incomingrequests.c b/source3/nmbd/nmbd_incomingrequests.c index ff4bb07a45..73abdf0050 100644 --- a/source3/nmbd/nmbd_incomingrequests.c +++ b/source3/nmbd/nmbd_incomingrequests.c @@ -213,7 +213,19 @@ IP %s on subnet %s\n", namestr(question), inet_ntoa(from_ip), subrec->subnet_nam /* See if the name already exists. */ namerec = find_name_on_subnet(subrec, question, FIND_ANY_NAME); - + + /* + * If the name being registered exists and is a WINS_PROXY_NAME + * then delete the WINS proxy name entry so we don't reply erroneously + * later to queries. + */ + + if((namerec != NULL) && (namerec->source == WINS_PROXY_NAME)) + { + remove_name_from_namelist( subrec, namerec ); + namerec = NULL; + } + if (!group) { /* Unique name. */ @@ -469,6 +481,28 @@ void process_name_query_request(struct subnet_record *subrec, struct packet_stru /* The requested name is a directed query, or it's SELF or PERMANENT or WINS_PROXY, or it's a Domain Master type. */ + /* + * If this is a WINS_PROXY_NAME, then ceck that none of the IP + * addresses we are returning is on the same broadcast subnet + * as the requesting packet. If it is then don't reply as the + * actual machine will be replying also and we don't want two + * replies to a broadcast query. + */ + + if(namerec->source == WINS_PROXY_NAME) + { + for( i = 0; i < namerec->num_ips; i++) + { + if(same_net( namerec->ip[i], subrec->myip, subrec->mask_ip )) + { + DEBUG(5,("process_name_query_request: name %s is a WINS proxy name and is also \ +on the same subnet (%s) as the requestor. Not replying.\n", + namestr(&namerec->name), subrec->subnet_name )); + return; + } + } + } + ttl = (namerec->death_time != PERMANENT_TTL) ? namerec->death_time - p->timestamp : lp_max_ttl(); |