r11710: added function iface_same_net()
authorAndrew Tridgell <tridge@samba.org>
Mon, 14 Nov 2005 01:50:26 +0000 (01:50 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:46:16 +0000 (13:46 -0500)
(This used to be commit 3e36b301947ccd4343bc294da59b13a8a9cfafce)

source4/lib/netif/interface.c

index 17a10c6799423e9b8c0c774ed90d5f37648d7366..2abb08e090b4daeefe6eea5f6df212beb0181078 100644 (file)
@@ -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));
+}