]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: dhcp6pd: drop link_has_preferred_subnet_id() and inline condition
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 5 Dec 2021 12:46:37 +0000 (21:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Dec 2021 10:43:06 +0000 (19:43 +0900)
src/network/networkd-dhcp-prefix-delegation.c

index 0bc922d4000473b25582790df2ff2d3add1c6066..2646aa65df099c1b076e392f338c4eea9f1289ba 100644 (file)
@@ -426,13 +426,6 @@ static int dhcp6_pd_request_address(
         return 0;
 }
 
-static bool link_has_preferred_subnet_id(Link *link) {
-        if (!link->network)
-                return false;
-
-        return link->network->dhcp6_pd_subnet_id >= 0;
-}
-
 static int dhcp6_pd_calculate_prefix(
                 const struct in6_addr *pd_prefix,
                 uint8_t pd_prefix_len,
@@ -471,9 +464,10 @@ static int dhcp6_pd_get_preferred_prefix(
 
         assert(link);
         assert(link->manager);
+        assert(link->network);
         assert(pd_prefix);
 
-        if (link_has_preferred_subnet_id(link)) {
+        if (link->network->dhcp6_pd_subnet_id >= 0) {
                 /* If the link has a preference for a particular subnet id try to allocate that */
 
                 r = dhcp6_pd_calculate_prefix(pd_prefix, pd_prefix_len, link->network->dhcp6_pd_subnet_id, &prefix);