mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 01:47:58 +02:00
core: ignore RA-provided default routes (rh #1029213)
The router has no idea what the local configuration or user preferences are, so sending routes with a prefix length of 0 is at best misinformed and at worst breaks things. The kernel also ignores plen=0 routes in its in-kernel RA processing code in net/ipv6/ndisc.c. https://bugzilla.redhat.com/show_bug.cgi?id=1029213
This commit is contained in:
parent
46a7760ead
commit
7994778723
1 changed files with 11 additions and 5 deletions
|
|
@ -3287,12 +3287,18 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *device
|
|||
NMRDiscRoute *discovered_route = &g_array_index (rdisc->routes, NMRDiscRoute, i);
|
||||
NMPlatformIP6Route route;
|
||||
|
||||
memset (&route, 0, sizeof (route));
|
||||
route.network = discovered_route->network;
|
||||
route.plen = discovered_route->plen;
|
||||
route.gateway = discovered_route->gateway;
|
||||
/* Only accept non-default routes. The router has no idea what the
|
||||
* local configuration or user preferences are, so sending routes
|
||||
* with a prefix length of 0 is quite rude and thus ignored.
|
||||
*/
|
||||
if (discovered_route->plen > 0) {
|
||||
memset (&route, 0, sizeof (route));
|
||||
route.network = discovered_route->network;
|
||||
route.plen = discovered_route->plen;
|
||||
route.gateway = discovered_route->gateway;
|
||||
|
||||
nm_ip6_config_add_route (priv->ac_ip6_config, &route);
|
||||
nm_ip6_config_add_route (priv->ac_ip6_config, &route);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue