From 171da4d78736730557a94b44af9f2d62081b80ba Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Jan 2000 06:55:36 +0000 Subject: this looks like a big commit, but it isn't really :) This fixes our netbios scope handling. We now have a 'netbios scope' option in smb.conf and the scope option is removed from make_nmb_name() this was prompted by a bug in our PDC finding code where it didn't append the scope to the query of the '*' name. (This used to be commit b563be824b8c3141c49558eced7829b48d4ab26f) --- source3/nmbd/nmbd_packets.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source3/nmbd/nmbd_packets.c') diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c index 3bf009f2c2..428758ada3 100644 --- a/source3/nmbd/nmbd_packets.c +++ b/source3/nmbd/nmbd_packets.c @@ -32,7 +32,6 @@ extern int DEBUGLEVEL; extern int num_response_packets; -extern pstring scope; extern struct in_addr loopback_ip; static void queue_packet(struct packet_struct *packet); @@ -1026,14 +1025,15 @@ static void process_browse_packet(struct packet_struct *p, char *buf,int len) struct dgram_packet *dgram = &p->packet.dgram; int command = CVAL(buf,0); struct subnet_record *subrec = find_subnet_for_dgram_browse_packet(p); + extern pstring global_scope; /* Drop the packet if it's a different NetBIOS scope, or the source is from one of our names. */ - if (!strequal(dgram->dest_name.scope,scope )) + if (!strequal(dgram->dest_name.scope, global_scope)) { DEBUG(7,("process_browse_packet: Discarding datagram from IP %s. Scope (%s) \ -mismatch with our scope (%s).\n", inet_ntoa(p->ip), dgram->dest_name.scope, scope)); +mismatch with our scope (%s).\n", inet_ntoa(p->ip), dgram->dest_name.scope, global_scope)); return; } @@ -1138,14 +1138,15 @@ static void process_lanman_packet(struct packet_struct *p, char *buf,int len) struct dgram_packet *dgram = &p->packet.dgram; int command = SVAL(buf,0); struct subnet_record *subrec = find_subnet_for_dgram_browse_packet(p); + extern pstring global_scope; /* Drop the packet if it's a different NetBIOS scope, or the source is from one of our names. */ - if (!strequal(dgram->dest_name.scope,scope )) + if (!strequal(dgram->dest_name.scope, global_scope)) { DEBUG(7,("process_lanman_packet: Discarding datagram from IP %s. Scope (%s) \ -mismatch with our scope (%s).\n", inet_ntoa(p->ip), dgram->dest_name.scope, scope)); +mismatch with our scope (%s).\n", inet_ntoa(p->ip), dgram->dest_name.scope, global_scope)); return; } @@ -1927,8 +1928,8 @@ BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len, dgram->header.dgm_length = 0; /* Let build_dgram() handle this. */ dgram->header.packet_offset = 0; - make_nmb_name(&dgram->source_name,srcname,src_type,scope); - make_nmb_name(&dgram->dest_name,dstname,dest_type,scope); + make_nmb_name(&dgram->source_name,srcname,src_type); + make_nmb_name(&dgram->dest_name,dstname,dest_type); ptr = &dgram->data[0]; -- cgit