From: Yu Watanabe Date: Tue, 2 Jan 2024 19:40:24 +0000 (+0900) Subject: network/address: not necessary to remmber address before remove X-Git-Tag: v256-rc1~1333^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1b73dbbc95d2414bc1acb35ccae25b94680d0df;p=thirdparty%2Fsystemd.git network/address: not necessary to remmber address before remove --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index cfa57aaa71f..dd1814bb994 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -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; }