diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-10-25 04:37:11 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-10-27 16:41:04 +0900 |
commit | acbb5500e23808f52938baf1c57420f5cf5375c0 (patch) | |
tree | 37a1217d07f356c030cd32eac5696b55a3618dd8 /src/libsystemd-network | |
parent | cfee6b955154c30be31ffcf0e3b7b89374a52fff (diff) | |
download | systemd-acbb5500e23808f52938baf1c57420f5cf5375c0.tar.gz |
sd-radv: use assert_return()
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/sd-radv.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libsystemd-network/sd-radv.c b/src/libsystemd-network/sd-radv.c index 2d91a406f8..9030150aee 100644 --- a/src/libsystemd-network/sd-radv.c +++ b/src/libsystemd-network/sd-radv.c @@ -550,9 +550,7 @@ _public_ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, int dynamic) { usec_t time_now, valid, preferred, valid_until, preferred_until; assert_return(ra, -EINVAL); - - if (!p) - return -EINVAL; + assert_return(p, -EINVAL); /* Refuse prefixes that don't have a prefix set */ if (in6_addr_is_null(&p->opt.in6_addr)) @@ -666,9 +664,7 @@ _public_ int sd_radv_add_route_prefix(sd_radv *ra, sd_radv_route_prefix *p, int int r; assert_return(ra, -EINVAL); - - if (!p) - return -EINVAL; + assert_return(p, -EINVAL); (void) in_addr_prefix_to_string(AF_INET6, (const union in_addr_union*) &p->opt.in6_addr, |