provider: Discard routes to VPN server via VPN tunnel
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Wed, 8 Aug 2012 10:22:48 +0000 (13:22 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 9 Aug 2012 09:16:56 +0000 (12:16 +0300)
commit66167bb34d24e5c66e26a0d45d7b70a664eb793f
tree7ff648a1ce9c517438029f1a83f664511d0d687f
parent2c5ca690ed80403f54229b005bc11cf87ba3e65b
provider: Discard routes to VPN server via VPN tunnel

These obsolete routes must be discarded as we cannot
contact VPN server via VPN tunnel. If the VPN server
address is not yet resolved, we do that while starting
the VPN client process.

Example of non working routes:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         UG    0      0        0 vpn0
10.10.15.0      0.0.0.0         255.255.255.0   U     0      0        0 wlan0
10.10.15.1      0.0.0.0         255.255.255.255 UH    0      0        0 wlan0
10.252.112.0    0.0.0.0         255.255.240.0   U     0      0        0 vpn0
193.229.0.40    10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
193.229.0.42    10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
113.108.211.91  0.0.0.0         255.255.255.255 UH    0      0        0 vpn0
113.108.211.91  10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0

The correct routes should be like this:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 vpn0
10.10.15.0      0.0.0.0         255.255.255.0   U     0      0        0 wlan0
10.10.15.1      0.0.0.0         255.255.255.255 UH    0      0        0 wlan0
10.252.112.0    0.0.0.0         255.255.240.0   U     0      0        0 vpn0
193.229.0.40    10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
193.229.0.42    10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
113.108.211.91  10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
src/provider.c