1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

network: dhcp-server: add two more log messages

This commit is contained in:
Yu Watanabe 2022-02-24 13:26:18 +09:00
parent 2971e2adf1
commit 745f0620ed

View File

@ -528,8 +528,7 @@ static int dhcp4_server_configure(Link *link) {
return log_link_error_errno(link, r, "Could not start DHCPv4 server instance: %m"); return log_link_error_errno(link, r, "Could not start DHCPv4 server instance: %m");
log_link_debug(link, "Offering DHCPv4 leases"); log_link_debug(link, "Offering DHCPv4 leases");
return 0;
return 1;
} }
static bool dhcp_server_is_ready_to_configure(Link *link) { static bool dhcp_server_is_ready_to_configure(Link *link) {
@ -569,17 +568,26 @@ static bool dhcp_server_is_ready_to_configure(Link *link) {
} }
int request_process_dhcp_server(Request *req) { int request_process_dhcp_server(Request *req) {
assert(req); Link *link;
assert(req->link); int r;
assert(req->type == REQUEST_TYPE_DHCP_SERVER);
if (!dhcp_server_is_ready_to_configure(req->link)) assert(req);
assert(req->type == REQUEST_TYPE_DHCP_SERVER);
assert_se(link = req->link);
if (!dhcp_server_is_ready_to_configure(link))
return 0; return 0;
return dhcp4_server_configure(req->link); r = dhcp4_server_configure(link);
if (r < 0)
return log_link_warning_errno(link, r, "Failed to configure DHCP server: %m");
return 1;
} }
int link_request_dhcp_server(Link *link) { int link_request_dhcp_server(Link *link) {
int r;
assert(link); assert(link);
if (!link_dhcp4_server_enabled(link)) if (!link_dhcp4_server_enabled(link))
@ -589,7 +597,11 @@ int link_request_dhcp_server(Link *link) {
return 0; return 0;
log_link_debug(link, "Requesting DHCP server."); log_link_debug(link, "Requesting DHCP server.");
return link_queue_request(link, REQUEST_TYPE_DHCP_SERVER, NULL, false, NULL, NULL, NULL); r = link_queue_request(link, REQUEST_TYPE_DHCP_SERVER, NULL, false, NULL, NULL, NULL);
if (r < 0)
return log_link_warning_errno(link, r, "Failed to request configuration of DHCP server: %m");
return 0;
} }
int config_parse_dhcp_server_relay_agent_suboption( int config_parse_dhcp_server_relay_agent_suboption(