diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-11-18 13:13:28 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-11-21 22:47:47 +0100 |
commit | fdedbe2676b4f9142246c6ac1f42181174ab22f0 (patch) | |
tree | e3070961ce296d834e768f0140fb2a9e08153f4e /src/libsystemd-network | |
parent | 7192bb81bd99108287db82d6140d5329086b0da2 (diff) |
basic: add explicit ipv4-specific in_addr classification calls
This adds in4_addr_is_localhost() and in4_addr_is_link_local() that only take
an IPv4 "struct in_addr", to match in_addr_is_localhost() and
in_addr_is_link_local() that that a "union in_addr_union".
This matches the existing in4_addr_is_null() call that already exists.
For IPv6 glibc already exports a set of macros, hence we don't add similar
functions in6_addr_is_localhost(). We also drop in6_addr_is_null() as
IN6_IS_ADDR_UNSPECIFIED() already provides that.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/ndisc-router.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/ndisc-router.c b/src/libsystemd-network/ndisc-router.c index 41ff2b353a..cf56c89d76 100644 --- a/src/libsystemd-network/ndisc-router.c +++ b/src/libsystemd-network/ndisc-router.c @@ -91,7 +91,7 @@ _public_ int sd_ndisc_router_get_address(sd_ndisc_router *rt, struct in6_addr *r assert_return(rt, -EINVAL); assert_return(ret_addr, -EINVAL); - if (in6_addr_is_null(&rt->address)) + if (IN6_IS_ADDR_UNSPECIFIED(&rt->address)) return -ENODATA; *ret_addr = rt->address; |