summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-06-19 13:46:51 -0500
committerDan Williams <dcbw@redhat.com>2013-06-19 13:49:12 -0500
commitc77c5669838bc84a0e51e964866d36c1696f1c16 (patch)
treed0b8ca890cbbca813818778be7594584583c9ecf
parenteea23747ce812260dd78a4a5d859945af48235fd (diff)
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.
-rw-r--r--src/nm-ip4-config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index 49ae654f..0044d913 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);