summaryrefslogtreecommitdiff
path: root/source3/libsmb/nmblib.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-01-28 11:04:05 +0100
committerStefan Metzmacher <metze@samba.org>2010-02-08 18:35:10 +0100
commit30a1bc365071befd07e68e24ca4fa3843159ab13 (patch)
tree46c66e57dda4239d21079d31ea3fbc4a6c49a4b7 /source3/libsmb/nmblib.c
parent6339de7f4fef46fb3ad32d1ecf9379f5b5d24ccb (diff)
downloadsamba-30a1bc365071befd07e68e24ca4fa3843159ab13.tar.gz
samba-30a1bc365071befd07e68e24ca4fa3843159ab13.tar.bz2
samba-30a1bc365071befd07e68e24ca4fa3843159ab13.zip
s3:nmbd: also listen explicit on the subnet broadcast addresses
And send replies always via the unicast address of the subnet. This behavior is off by default (as before) and can be enabled with "nmbd:bind explicit broadcast = yes". metze
Diffstat (limited to 'source3/libsmb/nmblib.c')
-rw-r--r--source3/libsmb/nmblib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 5f3eda44fe..1a2106675b 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -601,6 +601,8 @@ static struct packet_struct *copy_nmb_packet(struct packet_struct *packet)
/* Ensure this copy is not locked. */
pkt_copy->locked = False;
+ pkt_copy->recv_fd = -1;
+ pkt_copy->send_fd = -1;
/* Ensure this copy has no resource records. */
nmb = &packet->packet.nmb;
@@ -666,6 +668,8 @@ static struct packet_struct *copy_dgram_packet(struct packet_struct *packet)
/* Ensure this copy is not locked. */
pkt_copy->locked = False;
+ pkt_copy->recv_fd = -1;
+ pkt_copy->send_fd = -1;
/* There are no additional pointers in a dgram packet,
we are finished. */
@@ -791,7 +795,8 @@ struct packet_struct *read_packet(int fd,enum packet_type packet_type)
if (!packet)
return NULL;
- packet->fd = fd;
+ packet->recv_fd = fd;
+ packet->send_fd = -1;
DEBUG(5,("Received a packet of len %d from (%s) port %d\n",
length, inet_ntoa(packet->ip), packet->port ) );
@@ -1075,7 +1080,7 @@ bool send_packet(struct packet_struct *p)
if (!len)
return(False);
- return(send_udp(p->fd,buf,len,p->ip,p->port));
+ return(send_udp(p->send_fd,buf,len,p->ip,p->port));
}
/****************************************************************************