summaryrefslogtreecommitdiff
path: root/src/network/networkd-dhcp6.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-02-10 01:20:37 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-02-12 01:50:14 +0900
commit37c0b60177b2bc734ba562a698559151bdf1dbe1 (patch)
treecd7428283129156c657a6dcde2d8b0875e60e657 /src/network/networkd-dhcp6.c
parentfe44ce8dba13b0322f05b74c90e35e4347da211f (diff)
downloadsystemd-37c0b60177b2bc734ba562a698559151bdf1dbe1.tar.gz
network: automatically set NLM_F_REPLACE flag
The difference between sd_rtnl_message_new_addr() and sd_rtnl_message_new_addr_update() is only whether NLM_F_REPLACE flag will be set or not. If an address is already assigned, then we need to set NLM_F_REPLACE flag, otherwise, address_configure() will be fail. This makes address_configure() judge whether we should use the flag or not.
Diffstat (limited to 'src/network/networkd-dhcp6.c')
-rw-r--r--src/network/networkd-dhcp6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
index e643a92247..451b552345 100644
--- a/src/network/networkd-dhcp6.c
+++ b/src/network/networkd-dhcp6.c
@@ -391,7 +391,7 @@ static int dhcp6_set_pd_address(
address->cinfo.ifa_valid = lifetime_valid;
SET_FLAG(address->flags, IFA_F_MANAGETEMPADDR, link->network->dhcp6_pd_manage_temporary_address);
- r = address_configure(address, link, dhcp6_pd_address_handler, true, &ret);
+ r = address_configure(address, link, dhcp6_pd_address_handler, &ret);
if (r < 0)
return log_link_error_errno(link, r, "Failed to set DHCPv6 delegated prefix address: %m");
@@ -1034,7 +1034,7 @@ static int dhcp6_update_address(
log_dhcp6_address(link, addr, &buffer);
- r = address_configure(addr, link, dhcp6_address_handler, true, &ret);
+ r = address_configure(addr, link, dhcp6_address_handler, &ret);
if (r < 0)
return log_link_error_errno(link, r, "Failed to set DHCPv6 address %s/%u: %m",
strnull(buffer), addr->prefixlen);