[ELR#6] Add rules into local exclusion table
The local table will match the locally connected routes. Add
those rules when the VPN network is created. The local connected
rules are the link-local address for v6 and the link-local
(169.254.0.0/16) for v4. These rules are hardcoded but it should
depend on what actual subnet the network is which will be
addressed in the following patches.
Sample rule output:
24000: from all fwmark 0xc0066/0xcffff lookup ipsec1
25000: from all fwmark 0x0/0x10000 iif lo lookup wlan0_local
27000: from all fwmark 0x66/0xffff lookup wlan0
$ adb shell ip ro sh table wlan0_local
adb shell ip ro sh table wlan0_local
169.254.0.0/16 dev wlan0 proto static scope link
$ adb shell ip -6 ro sh table wlan0_local
fd00::/10 dev wlan0 proto static metric 1024 pref medium
Bug: 184750836
Test: cd system/netd ; atest
Test: atest HostsideVpnTests
Change-Id: Idb2188b05c2568c72c155a39d3c9f1cb6e3fa150
3 files changed