]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/address: also save/update priority of prefix route
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 9 Jul 2023 03:36:34 +0000 (12:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 30 Jul 2023 17:31:05 +0000 (02:31 +0900)
Strictly speaking, this is not necessary, but let's make the managed
Address objects more consistent with the kernel's addresses.

src/network/networkd-address.c

index 2dd02f5efbe9ad0c983466185ebd1a6e656fe446..e49d21f804d156047c9a88caafba8a69d484cf1e 100644 (file)
@@ -1687,6 +1687,10 @@ int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message,
         else if (r != -ENODATA)
                 log_link_debug_errno(link, r, "rtnl: failed to read IFA_CACHEINFO attribute, ignoring: %m");
 
+        r = sd_netlink_message_read_u32(message, IFA_RT_PRIORITY, &address->route_metric);
+        if (r < 0 && r != -ENODATA)
+                log_link_debug_errno(link, r, "rtnl: failed to read IFA_RT_PRIORITY attribute, ignoring: %m");
+
         address_enter_configured(address);
         if (req)
                 address_enter_configured(req->userdata);