network/address: always set IFA_ADDRESS attribute for IPv6 address on configure

IPv6 address can update the peer address without removing the address.
If an address have a peer, but now we want to drop the peer, we need to
specify a null address in IFA_ADDRESS attribute.

IPv4 address cannot update the peer address, so let's specify peer
address only when necessary.
This commit is contained in:
Yu Watanabe
2023-07-31 18:07:46 +09:00
parent b8e898a681
commit f35aecc416

View File

@@ -1256,7 +1256,7 @@ static int address_configure(const Address *address, const struct ifa_cacheinfo
if (r < 0)
return r;
if (in_addr_is_set(address->family, &address->in_addr_peer)) {
if (address->family == AF_INET6 || in_addr_is_set(address->family, &address->in_addr_peer)) {
r = netlink_message_append_in_addr_union(m, IFA_ADDRESS, address->family, &address->in_addr_peer);
if (r < 0)
return r;