]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/dhcp4: rename link_prefixroute() -> prefixroute_by_kernel()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 Jan 2025 21:58:06 +0000 (06:58 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 Jan 2025 21:58:09 +0000 (06:58 +0900)
No functional change, just refactoring.

src/network/networkd-dhcp4.c

index b42d2ffce020c4d4d52a94bb561eac07e7fd2bfa..8790b61ee222e1ae8b779cec364a19571306a966 100644 (file)
@@ -405,7 +405,7 @@ static int dhcp4_request_route(Route *route, Link *link) {
         return link_request_route(link, route, &link->dhcp4_messages, dhcp4_route_handler);
 }
 
-static bool link_prefixroute(Link *link) {
+static bool prefixroute_by_kernel(Link *link) {
         return !link->network->dhcp_route_table_set ||
                 link->network->dhcp_route_table == RT_TABLE_MAIN;
 }
@@ -417,8 +417,8 @@ static int dhcp4_request_prefix_route(Link *link) {
         assert(link);
         assert(link->dhcp_lease);
 
-        if (link_prefixroute(link))
-                /* When true, the route will be created by kernel. See dhcp4_update_address(). */
+        if (prefixroute_by_kernel(link))
+                /* The prefix route in the main table will be created by the kernel. See dhcp4_update_address(). */
                 return 0;
 
         r = route_new(&route);
@@ -968,7 +968,7 @@ static int dhcp4_request_address(Link *link, bool announce) {
         r = sd_dhcp_lease_get_broadcast(link->dhcp_lease, &addr->broadcast);
         if (r < 0 && r != -ENODATA)
                 return log_link_warning_errno(link, r, "DHCP: failed to get broadcast address: %m");
-        SET_FLAG(addr->flags, IFA_F_NOPREFIXROUTE, !link_prefixroute(link));
+        SET_FLAG(addr->flags, IFA_F_NOPREFIXROUTE, !prefixroute_by_kernel(link));
         addr->route_metric = link->network->dhcp_route_metric;
         addr->duplicate_address_detection = link->network->dhcp_send_decline ? ADDRESS_FAMILY_IPV4 : ADDRESS_FAMILY_NO;