From c76ab193dcc3285ce13ab2abcbcfce172874df70 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 28 Jul 2002 07:15:42 +0000 Subject: 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) --- source3/nmbd/nmbd_packets.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'source3/nmbd') 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()) { -- cgit