summaryrefslogtreecommitdiffstats
path: root/source/namepacket.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-10-18 00:22:04 +0000
committerJeremy Allison <jra@samba.org>1997-10-18 00:22:04 +0000
commitdb9aad07481f48c0fe2108d4ab0b2bc9b632816c (patch)
tree72e07931cc6bf67188d68989ae4912e4f53476d9 /source/namepacket.c
parent6904c2de080b2a9702800e9e4126386ced20569d (diff)
downloadsamba-db9aad07481f48c0fe2108d4ab0b2bc9b632816c.tar.gz
samba-db9aad07481f48c0fe2108d4ab0b2bc9b632816c.tar.xz
samba-db9aad07481f48c0fe2108d4ab0b2bc9b632816c.zip
After talking with Andrew added "interfaces only" parameter that
turns off the filtering on the broadcast socket by default. Jeremy (jallison@whistle.com)
Diffstat (limited to 'source/namepacket.c')
-rw-r--r--source/namepacket.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/source/namepacket.c b/source/namepacket.c
index 55c850f2544..ba1c4044a3b 100644
--- a/source/namepacket.c
+++ b/source/namepacket.c
@@ -622,18 +622,12 @@ BOOL listen_for_packets(BOOL run_election)
struct packet_struct *packet = read_packet(sock_array[i], NMB_PACKET);
if (packet)
{
-
/*
- * If we got a packet on the broadcast socket check it
- * came from one of our local nets. We should only be
- * receiving broadcasts from nets we have subnets for.
- *
- * Note that this filter precludes remote announces.
- * If we need this to work we will have to add an
- * 'allow local announce' parameter that gives a
- * list of networks we will allow through the filter.
+ * If we got a packet on the broadcast socket and interfaces
+ * only is set then check it came from one of our local nets.
*/
- if((sock_array[i] == ClientNMB) && (!is_local_net(packet->ip)))
+ if(lp_interfaces_only() && (sock_array[i] == ClientNMB) &&
+ (!is_local_net(packet->ip)))
{
DEBUG(7,("discarding nmb packet sent to broadcast socket from %s:%d\n",
inet_ntoa(packet->ip),packet->port));
@@ -663,16 +657,11 @@ BOOL listen_for_packets(BOOL run_election)
if (packet)
{
/*
- * If we got a packet on the broadcast socket check it
- * came from one of our local nets. We should only be
- * receiving broadcasts from nets we have subnets for.
- *
- * Note that this filter precludes remote announces.
- * If we need this to work we will have to add an
- * 'allow local announce' parameter that gives a
- * list of networks we will allow through the filter.
+ * If we got a packet on the broadcast socket and interfaces
+ * only is set then check it came from one of our local nets.
*/
- if((sock_array[i] == ClientDGRAM) && (!is_local_net(packet->ip)))
+ if(lp_interfaces_only() && (sock_array[i] == ClientDGRAM) &&
+ (!is_local_net(packet->ip)))
{
DEBUG(7,("discarding dgram packet sent to broadcast socket from %s:%d\n",
inet_ntoa(packet->ip),packet->port));