diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-03-12 20:21:11 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-03-12 20:21:11 +0000 |
commit | 0d51899b59204b99d5aeb9542c8adfff42167fec (patch) | |
tree | 2874d245edd64e06074c34c753d7d695e98b7848 /source/nameresp.c | |
parent | d998795503ce7872073a79a710a41ffdbc535e75 (diff) | |
download | samba-0d51899b59204b99d5aeb9542c8adfff42167fec.tar.gz samba-0d51899b59204b99d5aeb9542c8adfff42167fec.tar.xz samba-0d51899b59204b99d5aeb9542c8adfff42167fec.zip |
added code that checks whether the DOMAIN<1b> name is claimed on the
local subnet _before_ going and registering it. the reason for this
is that i don't want to cause chaos by registering the name twice.
it's ok to register DOMAIN<1b> with the WINS server, because the WINS
server's job is to check a) _if_ there's a current owner of the name
b) if the current owner exists c) if the current owner still wants the
name. if they don't, the WINS server responds by saying, 'yes, you can
have it'.
lkcl
Diffstat (limited to 'source/nameresp.c')
-rw-r--r-- | source/nameresp.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/nameresp.c b/source/nameresp.c index 949bb366bb9..77addc29852 100644 --- a/source/nameresp.c +++ b/source/nameresp.c @@ -160,6 +160,34 @@ static void dead_netbios_entry(struct subnet_record *d, break; } + case NAME_QUERY_DOMAIN: + { + /* if no response received, there is no domain controller on + this local subnet. it's ok for us to register + */ + + if (!n->bcast) + { + DEBUG(0,("NAME_QUERY_DOMAIN incorrectly used - contact samba-bugs!\n")); + /* XXXX whoops. someone's using this to unicast a packet. this state + should only be used for broadcast checks + */ + break; + } + if (n->num_msgs == 0) + { + if (ismyip(n->send_ip)) + { + struct work_record *work = find_workgroupstruct(d,n->name.name,False); + if (work && d) + { + become_domain_master(d,work); + } + } + } + break; + } + default: { /* nothing to do but delete the dead expected-response structure */ |