]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/address: not necessary to remmber address before remove
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Jan 2024 19:40:24 +0000 (04:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Jan 2024 19:43:34 +0000 (04:43 +0900)
src/network/networkd-address.c

index cfa57aaa71f1392a74d0ef6ff703f4c6b2bd1039..dd1814bb9947b7c2a960d9589b1754e1cfa41a9c 100644 (file)
@@ -1203,7 +1203,6 @@ int link_drop_ipv6ll_addresses(Link *link) {
                 _cleanup_(address_freep) Address *a = NULL;
                 unsigned char flags, prefixlen;
                 struct in6_addr address;
-                Address *existing;
                 int ifindex;
 
                 /* NETLINK_GET_STRICT_CHK socket option is supported since kernel 4.20. To support
@@ -1249,15 +1248,7 @@ int link_drop_ipv6ll_addresses(Link *link) {
                 a->prefixlen = prefixlen;
                 a->flags = flags;
 
-                if (address_get(link, a, &existing) < 0) {
-                        r = address_add(link, a);
-                        if (r < 0)
-                                return r;
-
-                        existing = TAKE_PTR(a);
-                }
-
-                r = address_remove(existing, link);
+                r = address_remove(a, link);
                 if (r < 0)
                         return r;
         }