summaryrefslogtreecommitdiff
path: root/source4/lib/netif
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-30 01:26:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:57 -0500
commitc58c7c416412fd2ae90427f500b2d94996c36c48 (patch)
tree504136e98bf0749c562b8ac0104f663a9d9d0def /source4/lib/netif
parentddffc922dfdc2572dc622d5fdb89095d356a83e9 (diff)
downloadsamba-c58c7c416412fd2ae90427f500b2d94996c36c48.tar.gz
samba-c58c7c416412fd2ae90427f500b2d94996c36c48.tar.bz2
samba-c58c7c416412fd2ae90427f500b2d94996c36c48.zip
r8002: favor addresses on our local interfaces in NBT name resolution if
possible. This is needed because w2k3 will return bogus IPs in its name resolution replies when it has an unplugged network interface. (This used to be commit 2fafc230520fb5bbe9f763de94aaba87b56f5411)
Diffstat (limited to 'source4/lib/netif')
-rw-r--r--source4/lib/netif/interface.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/netif/interface.c b/source4/lib/netif/interface.c
index 80041d5350..670913ab6f 100644
--- a/source4/lib/netif/interface.c
+++ b/source4/lib/netif/interface.c
@@ -353,3 +353,16 @@ const char *iface_best_ip(const char *dest)
}
return iface_n_ip(0);
}
+
+/*
+ return True if an IP is one one of our local networks
+*/
+BOOL iface_is_local(const char *dest)
+{
+ struct in_addr ip;
+ ip.s_addr = interpret_addr(dest);
+ if (iface_find(ip, True)) {
+ return True;
+ }
+ return False;
+}