summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-14 01:50:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:16 -0500
commitdf4624870b6edbf6c426ae5bc2807dcee205e69f (patch)
treebf32fd036a1d23db988af2917e87d37e1b180f08
parentb5fdc3609ece3c3f56ed8a56ae2171d240c97fff (diff)
downloadsamba-df4624870b6edbf6c426ae5bc2807dcee205e69f.tar.gz
samba-df4624870b6edbf6c426ae5bc2807dcee205e69f.tar.bz2
samba-df4624870b6edbf6c426ae5bc2807dcee205e69f.zip
r11710: added function iface_same_net()
(This used to be commit 3e36b301947ccd4343bc294da59b13a8a9cfafce)
-rw-r--r--source4/lib/netif/interface.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/lib/netif/interface.c b/source4/lib/netif/interface.c
index 17a10c6799..2abb08e090 100644
--- a/source4/lib/netif/interface.c
+++ b/source4/lib/netif/interface.c
@@ -370,3 +370,13 @@ BOOL iface_is_local(const char *dest)
}
return False;
}
+
+/*
+ return True if a IP matches a IP/netmask pair
+*/
+BOOL iface_same_net(const char *ip1, const char *ip2, const char *netmask)
+{
+ return same_net(interpret_addr2(ip1),
+ interpret_addr2(ip2),
+ interpret_addr2(netmask));
+}