summaryrefslogtreecommitdiff
path: root/lib/util/util_net.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-06-06 10:11:13 +1000
committerAndrew Tridgell <tridge@samba.org>2011-06-06 12:26:11 +1000
commitb81eac1e2b47b0f3885cfe8bb251eeb6245706f9 (patch)
tree04b0cebfe8adb130b11d10a47487ddf4c4c03f04 /lib/util/util_net.c
parentd1c90c465ee3d0bf60daf23c8eb9510071426c97 (diff)
downloadsamba-b81eac1e2b47b0f3885cfe8bb251eeb6245706f9.tar.gz
samba-b81eac1e2b47b0f3885cfe8bb251eeb6245706f9.tar.bz2
samba-b81eac1e2b47b0f3885cfe8bb251eeb6245706f9.zip
util-net: added is_ipaddress_v6()
Diffstat (limited to 'lib/util/util_net.c')
-rw-r--r--lib/util/util_net.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/util/util_net.c b/lib/util/util_net.c
index 57a0b1e40c..64aa674d8b 100644
--- a/lib/util/util_net.c
+++ b/lib/util/util_net.c
@@ -306,10 +306,10 @@ bool is_ipaddress_v4(const char *str)
}
/**
- * Return true if a string could be an IPv4 or IPv6 address.
+ * Return true if a string could be a IPv6 address.
*/
-bool is_ipaddress(const char *str)
+bool is_ipaddress_v6(const char *str)
{
#if defined(HAVE_IPV6)
int ret = -1;
@@ -337,7 +337,16 @@ bool is_ipaddress(const char *str)
}
}
#endif
- return is_ipaddress_v4(str);
+ return false;
+}
+
+/**
+ * Return true if a string could be an IPv4 or IPv6 address.
+ */
+
+bool is_ipaddress(const char *str)
+{
+ return is_ipaddress_v4(str) || is_ipaddress_v6(str);
}
/**