summaryrefslogtreecommitdiff
path: root/src/network/networkd-address.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r--src/network/networkd-address.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 255ff77022..85acc49945 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -209,10 +209,18 @@ int address_update(Address *address, Link *link,
if (r < 0)
return log_error_errno(r, "Could not set prefixlen: %m");
- r = sd_rtnl_message_addr_set_flags(req, IFA_F_PERMANENT);
+ address->flags |= IFA_F_PERMANENT;
+
+ r = sd_rtnl_message_addr_set_flags(req, address->flags & 0xff);
if (r < 0)
return log_error_errno(r, "Could not set flags: %m");
+ if (address->flags & ~0xff) {
+ r = sd_rtnl_message_append_u32(req, IFA_FLAGS, address->flags);
+ if (r < 0)
+ return log_error_errno(r, "Could not set extended flags: %m");
+ }
+
r = sd_rtnl_message_addr_set_scope(req, address->scope);
if (r < 0)
return log_error_errno(r, "Could not set scope: %m");
@@ -335,10 +343,18 @@ int address_configure(Address *address, Link *link,
if (r < 0)
return log_error_errno(r, "Could not set prefixlen: %m");
- r = sd_rtnl_message_addr_set_flags(req, IFA_F_PERMANENT);
+ address->flags |= IFA_F_PERMANENT;
+
+ r = sd_rtnl_message_addr_set_flags(req, (address->flags & 0xff));
if (r < 0)
return log_error_errno(r, "Could not set flags: %m");
+ if (address->flags & ~0xff) {
+ r = sd_rtnl_message_append_u32(req, IFA_FLAGS, address->flags);
+ if (r < 0)
+ return log_error_errno(r, "Could not set extended flags: %m");
+ }
+
r = sd_rtnl_message_addr_set_scope(req, address->scope);
if (r < 0)
return log_error_errno(r, "Could not set scope: %m");