network: drop fallback mechanism to assign DHCPv6 addresses with IFA_F_NOPREFIXROUTE
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Jul 2019 00:40:06 +0000 (09:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Jul 2019 14:13:40 +0000 (23:13 +0900)
The flag IFA_F_NOPREFIXROUTE was introduced in kernel-3.14. But even if
the kernel does not support the flag, it should be just ignored. So, it
is not necessary to do the fallback logic. Moreover, the current logic
is not a fallback mechanism but just retrying. So, it should not work.
Let's drop that.

src/network/networkd-dhcp6.c
src/network/networkd-link.c
src/network/networkd-link.h

index 7905e09..0a011c5 100644 (file)
@@ -405,21 +405,10 @@ static int dhcp6_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *
 
         r = sd_netlink_message_get_errno(m);
         if (r < 0 && r != -EEXIST) {
-                if (link->rtnl_extended_attrs) {
-                        log_link_warning(link, "Could not set extended netlink attributes, reverting to fallback mechanism");
-
-                        link->rtnl_extended_attrs = false;
-                        dhcp6_lease_address_acquired(link->dhcp6_client, link);
-
-                        return 1;
-                }
-
                 log_link_error_errno(link, r, "Could not set DHCPv6 address: %m");
-
                 link_enter_failed(link);
                 return 1;
-        }
-        if (r >= 0)
+        } else if (r >= 0)
                 (void) manager_rtnl_process_address(rtnl, m, link->manager);
 
         r = link_request_set_routes(link);
index a08ad80..63f7422 100644 (file)
@@ -605,7 +605,6 @@ static int link_new(Manager *manager, sd_netlink_message *message, Link **ret) {
                 .n_ref = 1,
                 .manager = manager,
                 .state = LINK_STATE_PENDING,
-                .rtnl_extended_attrs = true,
                 .ifindex = ifindex,
                 .iftype = iftype,
                 .sysctl_ipv6_enabled = -1,
index e8680bb..bfdcef0 100644 (file)
@@ -113,7 +113,6 @@ typedef struct Link {
         sd_radv *radv;
 
         sd_dhcp6_client *dhcp6_client;
-        bool rtnl_extended_attrs;
 
         /* This is about LLDP reception */
         sd_lldp *lldp;