After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751264 - Fails to delete automatic routes with metric=0 after connecting to VPN
Fails to delete automatic routes with metric=0 after connecting to VPN
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
1.0.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-06-20 15:52 UTC by maxtram95
Modified: 2015-07-01 14:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description maxtram95 2015-06-20 15:52:24 UTC
After I connect to Wi-Fi network, my route table looks like this:

default via 192.168.1.1 dev wlp3s0  proto static  metric 600 
192.168.1.0/24 dev wlp3s0  proto kernel  scope link  src 192.168.1.32  metric 600

After that I try to connect to OpenVPN (tap), and I see that route table now contains duplicate routes:

default via 192.168.1.1 dev tap0  proto static  metric 50 
default via 192.168.1.1 dev wlp3s0  proto static  metric 600 
xxx.xxx.xxx.xxx via 192.168.1.1 dev wlp3s0  proto static  metric 600 
192.168.1.0/24 dev wlp3s0  proto kernel  scope link  src 192.168.1.32 
192.168.1.0/24 dev tap0  proto kernel  scope link  src 192.168.1.16 
192.168.1.0/24 dev tap0  proto kernel  scope link  src 192.168.1.16  metric 50 
192.168.1.0/24 dev wlp3s0  proto kernel  scope link  src 192.168.1.32  metric 600

Routes with metric 0 are auto-created by kernel when interface comes up, and normally NetworkManager should remove them in nm_platform_ip4_address_sync(), but it doesn't, so networking works wrongly. Route table should look like this:

default via 192.168.1.1 dev tap0  proto static  metric 50 
default via 192.168.1.1 dev wlp3s0  proto static  metric 600 
xxx.xxx.xxx.xxx via 192.168.1.1 dev wlp3s0  proto static  metric 600 
192.168.1.0/24 dev tap0  proto kernel  scope link  src 192.168.1.16  metric 50 
192.168.1.0/24 dev wlp3s0  proto kernel  scope link  src 192.168.1.32  metric 600

Part of log after connecting to Wi-Fi:

NetworkManager[634]: <debug> [1434815160.882630] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: 192.168.1.0/24 via 0.0.0.0 dev wlp3s0 metric 600 mss 0 src kernel (src: 192.168.1.32)
NetworkManager[634]: <debug> [1434815160.882773] [platform/nm-platform.c:2040] nm_platform_ip4_route_delete(): route: deleting IPv4 route 192.168.1.0/24, metric=0, ifindex 3 dev wlp3s0
NetworkManager[634]: <debug> [1434815160.882962] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: 0.0.0.0/0 via 192.168.1.1 dev wlp3s0 metric 600 mss 0 src user

Part of log after connecting to VPN:

NetworkManager[634]: <debug> [1434815201.850263] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: 192.168.1.0/24 via 0.0.0.0 dev tap0 metric 50 mss 0 src kernel (src: 192.168.1.16)
NetworkManager[634]: <debug> [1434815201.850933] [platform/nm-platform.c:2040] nm_platform_ip4_route_delete(): route: deleting IPv4 route 192.168.1.0/24, metric=0, ifindex 38 dev tap0
NetworkManager[634]: <debug> [1434815201.852353] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: xxx.xxx.xxx.xxx/32 via 192.168.1.1 dev wlp3s0 metric 600 mss 0 src vpn
NetworkManager[634]: <debug> [1434815201.871332] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: 0.0.0.0/0 via 192.168.1.1 dev tap0 metric 50 mss 0 src vpn

I'm on Gentoo, NM version is 1.0.2, Linux 4.0.4, OpenVPN 2.3.6, libnl 3.2.26.
Comment 1 Thomas Haller 2015-06-24 12:14:46 UTC
Pushed branch for review: th/device-route-bgo751264
Comment 2 Lubomir Rintel 2015-07-01 13:45:17 UTC
Looks all fine to me.

> 604cf36 platform/trivial: rename enum value NM_IP_CONFIG_SOURCE_RTPROT_KERNEL
remove 'platform internal flag used to mark routes with protocol RTPROT_KERNEL' comment


> 551597f route-manager: manage IPv4 device-routes with NMRouteManager
please add a reference to the kernel ipv4 nodeviceroute bug to the timeout paragraph