From: Lennart Poettering Date: Mon, 26 Nov 2018 20:54:52 +0000 (+0100) Subject: sd-radv: simplify IPv6 address is-null check X-Git-Tag: v240~210^2~7 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=dc0ec5e25189125c4f3695b2550159d82c24a70d;p=systemd%2F.git sd-radv: simplify IPv6 address is-null check --- diff --git a/src/libsystemd-network/sd-radv.c b/src/libsystemd-network/sd-radv.c index e853dc8be6..bedc53e2bd 100644 --- a/src/libsystemd-network/sd-radv.c +++ b/src/libsystemd-network/sd-radv.c @@ -145,11 +145,13 @@ static int radv_send(sd_radv *ra, const struct in6_addr *dst, uint32_t router_li usec_t time_now; int r; + assert(ra); + r = sd_event_now(ra->event, clock_boottime_or_monotonic(), &time_now); if (r < 0) return r; - if (dst && !in_addr_is_null(AF_INET6, (union in_addr_union*) dst)) + if (dst && !IN6_IS_ADDR_UNSPECIFIED(dst)) dst_addr.sin6_addr = *dst; adv.nd_ra_type = ND_ROUTER_ADVERT;