From c77c5669838bc84a0e51e964866d36c1696f1c16 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 19 Jun 2013 13:46:51 -0500 Subject: [PATCH] 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. --- src/nm-ip4-config.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 49ae654f03..0044d913de 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -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);