diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/interface.c | 12 | ||||
-rw-r--r-- | source3/lib/util.c | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/source3/lib/interface.c b/source3/lib/interface.c index 1dc605ff2f..c920cc0cfc 100644 --- a/source3/lib/interface.c +++ b/source3/lib/interface.c @@ -400,6 +400,18 @@ BOOL ismybcast(struct in_addr bcast) } /**************************************************************************** + check if a packet is from a local (known) net + **************************************************************************/ +BOOL is_local_net(struct in_addr from) +{ + struct interface *i; + for (i=local_interfaces;i;i=i->next) + if((from.s_addr & i->nmask.s_addr) == (i->ip.s_addr & i->nmask.s_addr)) + return True; + return False; +} + +/**************************************************************************** how many interfaces do we have **************************************************************************/ int iface_count(void) diff --git a/source3/lib/util.c b/source3/lib/util.c index a82713a0d8..b69b30d20c 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3284,8 +3284,8 @@ int open_socket_in(int type, int port, int dlevel,uint32 socket_addr) { if (port) { if (port == SMB_PORT || port == NMB_PORT) - DEBUG(dlevel,("bind failed on port %d socket_addr=%x (%s)\n", - port,socket_addr,strerror(errno))); + DEBUG(dlevel,("bind failed on port %d socket_addr=%s (%s)\n", + port,inet_ntoa(sock.sin_addr),strerror(errno))); close(res); if (dlevel > 0 && port < 1000) |