summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-01-09 12:13:22 +0100
committerThomas Haller <thaller@redhat.com>2020-01-28 11:17:41 +0100
commit95ea3ccad8f0d22ec55d7cd2df3720bce262bc56 (patch)
tree30465bd63f71c5991ef6d29776ba451fd35c758d
parentcdfbbe651b73ff92e9c4c064f2768338a59905a5 (diff)
downloadNetworkManager-95ea3ccad8f0d22ec55d7cd2df3720bce262bc56.tar.gz
libnm: use nm_utils_ipaddr_is_valid() to implement nm_utils_ipaddr_valid()
-rw-r--r--libnm-core/nm-utils.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index a86fde1877..3fb067e046 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -4890,17 +4890,9 @@ nm_utils_inet6_ntop (const struct in6_addr *in6addr, char *dst)
gboolean
nm_utils_ipaddr_valid (int family, const char *ip)
{
- guint8 buf[sizeof (struct in6_addr)];
-
g_return_val_if_fail (family == AF_INET || family == AF_INET6 || family == AF_UNSPEC, FALSE);
- if (!ip)
- return FALSE;
-
- if (family == AF_UNSPEC)
- family = strchr (ip, ':') ? AF_INET6 : AF_INET;
-
- return inet_pton (family, ip, buf) == 1;
+ return nm_utils_ipaddr_is_valid (family, ip);
}
/**