diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-15 08:11:29 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-15 08:11:32 +0900 |
commit | 7abe175c007ce08be5f89d002b7e498c951f4537 (patch) | |
tree | eb4d118032a414a88522381b2519648712342d59 /src/network | |
parent | 1c49487284645a2a318f7ab2a7f2606a2cc75d53 (diff) | |
download | systemd-7abe175c007ce08be5f89d002b7e498c951f4537.tar.gz |
network: also unref IPv4 ACD clients in Address objects
This should not change any behavior, as currently link_free_engines() is
always called after all addresses are dropped. But the function may be
used in other places in the future. So, let's also stop the clients.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-address.c | 9 | ||||
-rw-r--r-- | src/network/networkd-address.h | 1 | ||||
-rw-r--r-- | src/network/networkd-link.c | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 0b269a1ba1..636812b556 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -1449,6 +1449,15 @@ int ipv4_dad_stop(Link *link) { return r; } +void ipv4_dad_unref(Link *link) { + Address *address; + + assert(link); + + SET_FOREACH(address, link->addresses) + address->acd = sd_ipv4acd_unref(address->acd); +} + int config_parse_broadcast( const char *unit, const char *filename, diff --git a/src/network/networkd-address.h b/src/network/networkd-address.h index c0552979c5..0104747d9a 100644 --- a/src/network/networkd-address.h +++ b/src/network/networkd-address.h @@ -65,6 +65,7 @@ int link_drop_foreign_addresses(Link *link); int link_serialize_addresses(Link *link, FILE *f); int link_deserialize_addresses(Link *link, const char *addresses); +void ipv4_dad_unref(Link *link); int ipv4_dad_stop(Link *link); int ipv4_dad_update_mac(Link *link); diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 324128be3c..4229e1f973 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -505,6 +505,8 @@ static void link_free_engines(Link *link) { link->dhcp6_lease = sd_dhcp6_lease_unref(link->dhcp6_lease); link->ndisc = sd_ndisc_unref(link->ndisc); link->radv = sd_radv_unref(link->radv); + + ipv4_dad_unref(link); } static Link *link_free(Link *link) { |