]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: rename dhcp_lease_lost() -> dhcp4_lease_lost() and expose it
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 22 Jun 2021 10:48:55 +0000 (19:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 30 Jun 2021 15:49:02 +0000 (00:49 +0900)
A preparation for later commits.

src/network/networkd-dhcp4.c
src/network/networkd-dhcp4.h

index 878b306c1feac5fded9b32d1617fc9db6f5b1a24..1aaeda98e286104e8d623f3484852a72290c7532 100644 (file)
@@ -738,7 +738,7 @@ static int dhcp4_remove_all(Link *link) {
         return r;
 }
 
-static int dhcp_lease_lost(Link *link) {
+int dhcp4_lease_lost(Link *link) {
         int k, r = 0;
 
         assert(link);
@@ -748,7 +748,7 @@ static int dhcp_lease_lost(Link *link) {
 
         link->dhcp4_configured = false;
 
-        /* dhcp_lease_lost() may be called during renewing IP address. */
+        /* dhcp4_lease_lost() may be called during renewing IP address. */
         k = dhcp4_release_old_lease(link);
         if (k < 0)
                 r = k;
@@ -813,7 +813,7 @@ static void dhcp_address_on_acd(sd_ipv4acd *acd, int event, void *userdata) {
                         log_link_warning_errno(link, r, "Failed to send DHCP DECLINE, ignoring: %m");
 
                 if (link->dhcp_lease) {
-                        r = dhcp_lease_lost(link);
+                        r = dhcp4_lease_lost(link);
                         if (r < 0)
                                 link_enter_failed(link);
                 }
@@ -1180,7 +1180,7 @@ static int dhcp_lease_ip_change(sd_dhcp_client *client, Link *link) {
 
         r = dhcp_lease_acquired(client, link);
         if (r < 0)
-                (void) dhcp_lease_lost(link);
+                (void) dhcp4_lease_lost(link);
 
         return r;
 }
@@ -1276,7 +1276,7 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) {
                                                                     r, "Failed to send DHCP RELEASE, ignoring: %m");
                                 }
 
-                                r = dhcp_lease_lost(link);
+                                r = dhcp4_lease_lost(link);
                                 if (r < 0) {
                                         link_enter_failed(link);
                                         return r;
@@ -1291,7 +1291,7 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) {
                         }
 
                         if (link->dhcp_lease) {
-                                r = dhcp_lease_lost(link);
+                                r = dhcp4_lease_lost(link);
                                 if (r < 0) {
                                         link_enter_failed(link);
                                         return r;
index a33fe403be87003aaab7c9d662ffdbabcf27490c..e41e39fc6e941ade3189914d3d1071124c300809 100644 (file)
@@ -21,6 +21,7 @@ void network_adjust_dhcp4(Network *network);
 int dhcp4_configure(Link *link);
 int dhcp4_update_mac(Link *link);
 int dhcp4_start(Link *link);
+int dhcp4_lease_lost(Link *link);
 
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_client_identifier);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_acl_ip_address);