]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/libsystemd-network/sd-radv.c
sd-radv: remove unnecessary check
[thirdparty/systemd.git] / src / libsystemd-network / sd-radv.c
index b8c5d1fbfd19d473ea1484240ca97347df70b549..c384d4e6275c0f9068ab2fec228087846137d1ba 100644 (file)
@@ -614,7 +614,6 @@ int sd_radv_set_home_agent_lifetime(sd_radv *ra, uint64_t lifetime_usec) {
 
 int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p) {
         sd_radv_prefix *found = NULL;
-        int r;
 
         assert_return(ra, -EINVAL);
         assert_return(p, -EINVAL);
@@ -626,11 +625,8 @@ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p) {
         const char *addr_p = IN6_ADDR_PREFIX_TO_STRING(&p->opt.in6_addr, p->opt.prefixlen);
 
         LIST_FOREACH(prefix, cur, ra->prefixes) {
-                r = in6_addr_prefix_intersect(&cur->opt.in6_addr, cur->opt.prefixlen,
-                                              &p->opt.in6_addr, p->opt.prefixlen);
-                if (r < 0)
-                        return r;
-                if (r == 0)
+                if (!in6_addr_prefix_intersect(&cur->opt.in6_addr, cur->opt.prefixlen,
+                                               &p->opt.in6_addr, p->opt.prefixlen))
                         continue; /* no intersection */
 
                 if (cur->opt.prefixlen == p->opt.prefixlen) {