nbt_server: add some debug messages which show the used interfaces addresses
authorStefan Metzmacher <metze@sernet.de>
Wed, 16 Jan 2008 12:43:07 +0000 (13:43 +0100)
committerStefan Metzmacher <metze@sernet.de>
Wed, 16 Jan 2008 12:43:07 +0000 (13:43 +0100)
metze

source/nbt_server/interfaces.c

index 3bfb8ca5bf7792e09e7c48975b1597f7bb0f92e9..bae2012b7584e22aa3134e65ea9ffa60fba435d3 100644 (file)
@@ -105,6 +105,8 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv,
        struct socket_address *bcast_address;
        struct socket_address *unicast_address;
 
+       DEBUG(6,("nbtd_add_socket(%s, %s, %s, %s)\n", bind_address, address, bcast, netmask));
+
        /*
          we actually create two sockets. One listens on the broadcast address
          for the interface, and the other listens on our specific address. This
@@ -312,18 +314,27 @@ struct nbtd_interface *nbtd_find_interface(struct nbtd_server *nbtd_server,
                                           const char *address)
 {
        struct nbtd_interface *iface;
+
        /* try to find a exact match */
        for (iface=nbtd_server->interfaces;iface;iface=iface->next) {
                if (iface_same_net(address, iface->ip_address, iface->netmask)) {
+                       DEBUG(10,("find interface for dst[%s] ip: %s/%s (iface[%p])\n",
+                                 address, iface->ip_address, iface->netmask, iface));
                        return iface;
                }
        }
 
        /* no exact match, if we have the broadcast interface, use that */
        if (nbtd_server->bcast_interface) {
-               return nbtd_server->bcast_interface;
+               iface = nbtd_server->bcast_interface;
+               DEBUG(10,("find interface for dst[%s] ip: %s/%s (bcast iface[%p])\n",
+                       address, iface->ip_address, iface->netmask, iface));
+               return iface;
        }
 
        /* fallback to first interface */
-       return nbtd_server->interfaces;
+       iface = nbtd_server->interfaces;
+       DEBUG(10,("find interface for dst[%s] ip: %s/%s (default iface[%p])\n",
+               address, iface->ip_address, iface->netmask, iface));
+       return iface;
 }