diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-01-28 11:04:05 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-02-08 18:35:10 +0100 |
commit | 30a1bc365071befd07e68e24ca4fa3843159ab13 (patch) | |
tree | 46c66e57dda4239d21079d31ea3fbc4a6c49a4b7 /source3/libsmb | |
parent | 6339de7f4fef46fb3ad32d1ecf9379f5b5d24ccb (diff) | |
download | samba-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')
-rw-r--r-- | source3/libsmb/namequery.c | 6 | ||||
-rw-r--r-- | source3/libsmb/nmblib.c | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index a6fc612a0f..be038ecdad 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -289,7 +289,8 @@ NODE_STATUS_STRUCT *node_status_query(int fd, p.ip = ((const struct sockaddr_in *)to_ss)->sin_addr; p.port = NMB_PORT; - p.fd = fd; + p.recv_fd = -1; + p.send_fd = fd; p.timestamp = time(NULL); p.packet_type = NMB_PACKET; @@ -698,7 +699,8 @@ struct sockaddr_storage *name_query(int fd, p.ip = ((struct sockaddr_in *)to_ss)->sin_addr; p.port = NMB_PORT; - p.fd = fd; + p.recv_fd = -1; + p.send_fd = fd; p.timestamp = time(NULL); p.packet_type = NMB_PACKET; 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)); } /**************************************************************************** |