mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-27 21:00:35 +01:00
dhcp/dhclient: fix setting "src" attribute for certain routes
Fixes:2dc7a3d9f9('dhcp: set "src" for DHCPv4 routes') (cherry picked from commit197e73ac7c) (cherry picked from commit0c6d242dc0)
This commit is contained in:
parent
f2942d11a7
commit
b0a7dda2ea
1 changed files with 7 additions and 2 deletions
|
|
@ -277,7 +277,10 @@ ip4_process_classless_routes(const char *iface,
|
|||
}
|
||||
|
||||
static void
|
||||
process_classful_routes(const char *iface, GHashTable *options, NML3ConfigData *l3cd)
|
||||
process_classful_routes(const char *iface,
|
||||
GHashTable *options,
|
||||
NML3ConfigData *l3cd,
|
||||
in_addr_t address)
|
||||
{
|
||||
gs_free const char **searches = NULL;
|
||||
const char **s;
|
||||
|
|
@ -325,6 +328,7 @@ process_classful_routes(const char *iface, GHashTable *options, NML3ConfigData *
|
|||
route.plen = 32;
|
||||
}
|
||||
route.gateway = rt_route;
|
||||
route.pref_src = address;
|
||||
route.rt_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.table_any = TRUE;
|
||||
route.table_coerced = 0;
|
||||
|
|
@ -427,7 +431,7 @@ nm_dhcp_utils_ip4_config_from_options(NMDedupMultiIndex *multi_idx,
|
|||
* the 'static_routes' option.
|
||||
*/
|
||||
if (!ip4_process_classless_routes(iface, options, l3cd, address.address, &gateway))
|
||||
process_classful_routes(iface, options, l3cd);
|
||||
process_classful_routes(iface, options, l3cd, address.address);
|
||||
|
||||
if (gateway) {
|
||||
_LOG2I(LOGD_DHCP4, iface, " gateway %s", _nm_utils_inet4_ntop(gateway, sbuf));
|
||||
|
|
@ -457,6 +461,7 @@ nm_dhcp_utils_ip4_config_from_options(NMDedupMultiIndex *multi_idx,
|
|||
const NMPlatformIP4Route r = {
|
||||
.rt_source = NM_IP_CONFIG_SOURCE_DHCP,
|
||||
.gateway = gateway,
|
||||
.pref_src = address.address,
|
||||
.table_any = TRUE,
|
||||
.table_coerced = 0,
|
||||
.metric_any = TRUE,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue