mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 10:50:11 +01:00
core: ignore default routes when creating configuration for generic interface
NM handles the default routes, so they shouldn't show up in the NMIP4Config for any interface. They get exposed via the 'default' and 'default6' properties of the ActiveConnection instead.
This commit is contained in:
parent
eea23747ce
commit
c77c566983
1 changed files with 6 additions and 0 deletions
|
|
@ -129,6 +129,12 @@ nm_ip4_config_new_for_interface (int ifindex)
|
|||
routes_array = nm_platform_ip4_route_get_all (ifindex);
|
||||
routes = (NMPlatformIP4Route *)routes_array->data;
|
||||
for (i = 0; i < routes_array->len; i++) {
|
||||
/* Default route ignored; it's handled internally by NM and not
|
||||
* tracked in the device's IP config.
|
||||
*/
|
||||
if (routes[i].plen == 0)
|
||||
continue;
|
||||
|
||||
route = nm_ip4_route_new ();
|
||||
nm_ip4_route_set_dest (route, routes[i].network);
|
||||
nm_ip4_route_set_prefix (route, routes[i].plen);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue