}
static int dhcp4_request_prefix_route(Link *link) {
- _cleanup_(route_freep) Route *route = NULL;
+ _cleanup_(route_unrefp) Route *route = NULL;
int r;
assert(link);
}
static int dhcp4_request_route_to_gateway(Link *link, const struct in_addr *gw) {
- _cleanup_(route_freep) Route *route = NULL;
+ _cleanup_(route_unrefp) Route *route = NULL;
struct in_addr address;
int r;
return r;
FOREACH_ARRAY(e, routes, n_routes) {
- _cleanup_(route_freep) Route *route = NULL;
+ _cleanup_(route_unrefp) Route *route = NULL;
struct in_addr gw;
r = route_new(&route);
}
static int dhcp4_request_default_gateway(Link *link) {
- _cleanup_(route_freep) Route *route = NULL;
+ _cleanup_(route_unrefp) Route *route = NULL;
struct in_addr address, router;
int r;
assert(link->network);
HASHMAP_FOREACH(rt, link->network->routes_by_section) {
- _cleanup_(route_freep) Route *route = NULL;
+ _cleanup_(route_unrefp) Route *route = NULL;
struct in_addr gw;
if (!rt->gateway_from_dhcp_or_ra)
assert(servers || n_servers == 0);
FOREACH_ARRAY(dst, servers, n_servers) {
- _cleanup_(route_freep) Route *route = NULL;
+ _cleanup_(route_unrefp) Route *route = NULL;
struct in_addr gw;
if (in4_addr_is_null(dst))
assert(link);
assert(link->network);
+ /* If it is explicitly specified, then honor the setting. */
if (link->network->dhcp_ipv6_only_mode >= 0)
return link->network->dhcp_ipv6_only_mode;
- return link_dhcp6_enabled(link) || link_ipv6_accept_ra_enabled(link);
+ /* Defaults to false, until we support 464XLAT. See issue #30891. */
+ return false;
}
static int dhcp4_configure(Link *link) {
return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set request flag for classless static route: %m");
}
- if (link->network->dhcp_use_domains != DHCP_USE_DOMAINS_NO) {
+ if (link->network->dhcp_use_domains > 0) {
r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_DOMAIN_SEARCH);
if (r < 0)
return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set request flag for domain search list: %m");
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);