1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

network: rename dhcp_lease_lost() -> dhcp4_lease_lost() and expose it

A preparation for later commits.
This commit is contained in:
Yu Watanabe 2021-06-22 19:48:55 +09:00
parent d5e3b3eb8c
commit 9155da08ee
2 changed files with 7 additions and 6 deletions

View File

@ -738,7 +738,7 @@ static int dhcp4_remove_all(Link *link) {
return r; return r;
} }
static int dhcp_lease_lost(Link *link) { int dhcp4_lease_lost(Link *link) {
int k, r = 0; int k, r = 0;
assert(link); assert(link);
@ -748,7 +748,7 @@ static int dhcp_lease_lost(Link *link) {
link->dhcp4_configured = false; 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); k = dhcp4_release_old_lease(link);
if (k < 0) if (k < 0)
r = k; 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"); log_link_warning_errno(link, r, "Failed to send DHCP DECLINE, ignoring: %m");
if (link->dhcp_lease) { if (link->dhcp_lease) {
r = dhcp_lease_lost(link); r = dhcp4_lease_lost(link);
if (r < 0) if (r < 0)
link_enter_failed(link); 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); r = dhcp_lease_acquired(client, link);
if (r < 0) if (r < 0)
(void) dhcp_lease_lost(link); (void) dhcp4_lease_lost(link);
return r; 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, "Failed to send DHCP RELEASE, ignoring: %m");
} }
r = dhcp_lease_lost(link); r = dhcp4_lease_lost(link);
if (r < 0) { if (r < 0) {
link_enter_failed(link); link_enter_failed(link);
return r; return r;
@ -1291,7 +1291,7 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) {
} }
if (link->dhcp_lease) { if (link->dhcp_lease) {
r = dhcp_lease_lost(link); r = dhcp4_lease_lost(link);
if (r < 0) { if (r < 0) {
link_enter_failed(link); link_enter_failed(link);
return r; return r;

View File

@ -21,6 +21,7 @@ void network_adjust_dhcp4(Network *network);
int dhcp4_configure(Link *link); int dhcp4_configure(Link *link);
int dhcp4_update_mac(Link *link); int dhcp4_update_mac(Link *link);
int dhcp4_start(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_client_identifier);
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_acl_ip_address); CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_acl_ip_address);