s3-nmbd: don't discard DGRAM frames from local addresses when we are a DC
authorMatthieu Patou <mat@matws.net>
Sat, 28 Jan 2012 00:12:52 +0000 (16:12 -0800)
committerMatthieu Patou <mat@samba.org>
Fri, 3 Feb 2012 10:09:29 +0000 (11:09 +0100)
Winbind use netbios to locate the DC, if samba is also a DC then nmbd
receive request from Winbind that are from a local address, those
requests must not be discarded otherwise winbind can't find the DC and
won't try another method.

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Fri Feb  3 11:09:29 CET 2012 on sn-devel-104

source3/nmbd/nmbd_packets.c

index da38dcfbfeb5350da0da142e4c46d214fe81847e..edac6f6b9ff3c12a66608e489a99d8478c8fb44e 100644 (file)
@@ -1995,21 +1995,23 @@ bool listen_for_packets(struct messaging_context *msg, bool run_election)
                        continue;
                }
 
-               if ((is_loopback_ip_v4(packet->ip) || ismyip_v4(packet->ip)) &&
-                   packet->port == client_port)
-               {
-                       if (client_port == DGRAM_PORT) {
-                               DEBUG(7,("discarding own dgram packet from %s:%d\n",
-                                       inet_ntoa(packet->ip),packet->port));
-                               free_packet(packet);
-                               continue;
-                       }
-
-                       if (packet->packet.nmb.header.nm_flags.bcast) {
-                               DEBUG(7,("discarding own nmb bcast packet from %s:%d\n",
-                                       inet_ntoa(packet->ip),packet->port));
-                               free_packet(packet);
-                               continue;
+               if (!IS_DC) {
+                       if ((is_loopback_ip_v4(packet->ip) || ismyip_v4(packet->ip)) &&
+                       packet->port == client_port)
+                       {
+                               if (client_port == DGRAM_PORT) {
+                                       DEBUG(7,("discarding own dgram packet from %s:%d\n",
+                                               inet_ntoa(packet->ip),packet->port));
+                                       free_packet(packet);
+                                       continue;
+                               }
+
+                               if (packet->packet.nmb.header.nm_flags.bcast) {
+                                       DEBUG(7,("discarding own nmb bcast packet from %s:%d\n",
+                                               inet_ntoa(packet->ip),packet->port));
+                                       free_packet(packet);
+                                       continue;
+                               }
                        }
                }