summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-07-31 11:07:46 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-07-31 11:15:26 +0200
commitf35aecc4168ba99dc4319954593b2adc31c17c10 (patch)
tree3c42423567d2f26149976c4f62e0e2855d5ad835 /src/network
parentnetwork/address: make Label= accept an empty string (diff)
downloadsystemd-f35aecc4168ba99dc4319954593b2adc31c17c10.tar.xz
systemd-f35aecc4168ba99dc4319954593b2adc31c17c10.zip
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.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-address.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index a7772a5895..2a46f051e0 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -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;