summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-07-28 07:15:42 +0000
committerAndrew Tridgell <tridge@samba.org>2002-07-28 07:15:42 +0000
commitc76ab193dcc3285ce13ab2abcbcfce172874df70 (patch)
tree9cf11995d909f0de424a7045f0dba4b967d58313 /source3
parent5b5208a0b86c0c3d745f7a9694b4096a6b26043b (diff)
downloadsamba-c76ab193dcc3285ce13ab2abcbcfce172874df70.tar.gz
samba-c76ab193dcc3285ce13ab2abcbcfce172874df70.tar.bz2
samba-c76ab193dcc3285ce13ab2abcbcfce172874df70.zip
this is an interim fix for nmbd not registering DOMAIN#1b with WINS
when a PDC. The fix does not iterate over all WINS tags, which it should do, but after having looked at doing that it gets *very* messy to do with our current code base. (This used to be commit 434e5124db28134ebfc9840cf0839d77987db65e)
Diffstat (limited to 'source3')
-rw-r--r--source3/nmbd/nmbd_packets.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index 4bd949f5a3..105fb60e99 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -705,14 +705,33 @@ struct response_record *queue_query_name( struct subnet_record *subrec,
{
struct packet_struct *p;
struct response_record *rrec;
+ struct in_addr to_ip;
if(assert_check_subnet(subrec))
return NULL;
+ to_ip = subrec->bcast_ip;
+
+ /* queries to the WINS server turn up here as queries to IP 0.0.0.0
+ These need to be handled a bit differently */
+ if (subrec->type == UNICAST_SUBNET && is_zero_ip(to_ip)) {
+ /* what we really need to do is loop over each of our wins
+ * servers and wins server tags here, but that just doesn't
+ * fit our architecture at the moment (userdata may already
+ * be used when we get here). For now we just query the first
+ * active wins server on the first tag. */
+ char **tags = wins_srv_tags();
+ if (!tags) {
+ return NULL;
+ }
+ to_ip = wins_srv_ip_tag(tags[0], to_ip);
+ wins_srv_tags_free(tags);
+ }
+
if(( p = create_and_init_netbios_packet(nmbname,
(subrec != unicast_subnet),
(subrec == unicast_subnet),
- subrec->bcast_ip)) == NULL)
+ to_ip)) == NULL)
return NULL;
if(lp_bind_interfaces_only()) {