From c97df0d892d71462dfd631cf5e93f04641afaab3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 16 Jan 2008 13:43:07 +0100 Subject: nbt_server: add some debug messages which show the used interfaces addresses metze (from samba4wins tree 8eb30add7c95672a85b4084b4a3dbfa78db820c4) --- source4/nbt_server/interfaces.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index d466db514d..f5ac49255a 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -109,6 +109,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 @@ -326,17 +328,25 @@ struct nbtd_interface *nbtd_find_request_iface(struct nbtd_server *nbtd_server, /* try to find a exact match */ for (cur=nbtd_server->interfaces;cur;cur=cur->next) { if (iface_same_net(address, cur->ip_address, cur->netmask)) { + DEBUG(10,("find interface for dst[%s] ip: %s/%s (iface[%p])\n", + address, cur->ip_address, cur->netmask, cur)); return cur; } } /* no exact match, if we have the broadcast interface, use that */ if (allow_bcast_iface && nbtd_server->bcast_interface) { - return nbtd_server->bcast_interface; + cur = nbtd_server->bcast_interface; + DEBUG(10,("find interface for dst[%s] ip: %s/%s (bcast iface[%p])\n", + address, cur->ip_address, cur->netmask, cur)); + return cur; } /* fallback to first interface */ - return nbtd_server->interfaces; + cur = nbtd_server->interfaces; + DEBUG(10,("find interface for dst[%s] ip: %s/%s (default iface[%p])\n", + address, cur->ip_address, cur->netmask, cur)); + return cur; } /* -- cgit