diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 1a6f3d33cd..38227b082a 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -269,7 +269,8 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex, int priority) /* Don't add the route if it's more specific than one of the subnets * the device already has an IP address on. */ - if (nm_ip4_config_destination_is_direct (config, route.network, route.plen)) + if ( route.gateway == 0 + && nm_ip4_config_destination_is_direct (config, route.network, route.plen)) continue; /* Don't add the default route when and the connection diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index c6f213a7ae..7de01ece42 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -270,7 +270,8 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex, int priority) /* Don't add the route if it's more specific than one of the subnets * the device already has an IP address on. */ - if (nm_ip6_config_destination_is_direct (config, &route.network, route.plen)) + if ( IN6_IS_ADDR_UNSPECIFIED (&route.gateway) + && nm_ip6_config_destination_is_direct (config, &route.network, route.plen)) continue; /* Don't add the default route when and the connection