summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-10-25 04:37:11 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-10-27 16:41:04 +0900
commitacbb5500e23808f52938baf1c57420f5cf5375c0 (patch)
tree37a1217d07f356c030cd32eac5696b55a3618dd8 /src/libsystemd-network
parentcfee6b955154c30be31ffcf0e3b7b89374a52fff (diff)
downloadsystemd-acbb5500e23808f52938baf1c57420f5cf5375c0.tar.gz
sd-radv: use assert_return()
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-radv.c8
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,