networkd: support setting dhcp server port
This commit is contained in:
committed by
Yu Watanabe
parent
e5aa8c193d
commit
ea932bd34d
@@ -1634,6 +1634,11 @@ static int dhcp4_configure(Link *link) {
|
||||
if (r < 0)
|
||||
return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set listen port: %m");
|
||||
}
|
||||
if (link->network->dhcp_port > 0) {
|
||||
r = sd_dhcp_client_set_port(link->dhcp_client, link->network->dhcp_port);
|
||||
if (r < 0)
|
||||
return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set server port: %m");
|
||||
}
|
||||
|
||||
if (link->network->dhcp_max_attempts > 0) {
|
||||
r = sd_dhcp_client_set_max_attempts(link->dhcp_client, link->network->dhcp_max_attempts);
|
||||
|
||||
@@ -248,6 +248,7 @@ DHCPv4.RouteMetric, config_parse_dhcp_route_metric,
|
||||
DHCPv4.RouteTable, config_parse_dhcp_or_ra_route_table, AF_INET, 0
|
||||
DHCPv4.UseTimezone, config_parse_bool, 0, offsetof(Network, dhcp_use_timezone)
|
||||
DHCPv4.ListenPort, config_parse_uint16, 0, offsetof(Network, dhcp_client_port)
|
||||
DHCPv4.ServerPort, config_parse_uint16, 0, offsetof(Network, dhcp_port)
|
||||
DHCPv4.SendRelease, config_parse_bool, 0, offsetof(Network, dhcp_send_release)
|
||||
DHCPv4.SendDecline, config_parse_bool, 0, offsetof(Network, dhcp_send_decline)
|
||||
DHCPv4.DenyList, config_parse_in_addr_prefixes, AF_INET, offsetof(Network, dhcp_deny_listed_ip)
|
||||
|
||||
@@ -132,6 +132,7 @@ struct Network {
|
||||
usec_t dhcp_fallback_lease_lifetime_usec;
|
||||
uint32_t dhcp_route_mtu;
|
||||
uint16_t dhcp_client_port;
|
||||
uint16_t dhcp_port;
|
||||
int dhcp_critical;
|
||||
int dhcp_ip_service_type;
|
||||
int dhcp_socket_priority;
|
||||
|
||||
Reference in New Issue
Block a user