Add app default local rule
Add an app default local rule prior to the VPN local route rule
to route the per app default local traffic.
If the routes setting for system default and app default are
overlapped with each other, the traffic may be routed
unexpectedly becuase the VPN local rules do not contain the
uid range information. The rule will match first before app
default rule. Thus, add an default local rule piror to the
VPN local route rule to address the issue.
Sample rule after applying the change:
- App UID(99999)
- Default(iface0), app default(iface1), vpn(tun0)
25000: ... 0x0/0x10000 iif lo uidrange 99998-99999 lookup iface1_local
26000: ... 0x0/0x10000 iif lo lookup iface0_local
27000: ... 0x0/0x30000 iif lo uidrange 99997-99998 lookup tun0
28000: ... 0xffdf/0xffff lookup iface0
29000: ... 0x0/0xffff iif lo uidrange 99998-99999 lookup iface1
30000: ... 0x0/0xffff iif lo lookup iface0
Bug: 184750836
Test: cd system/netd ; atest
Change-Id: Ic092398a0d89b0104afcee8e1f22dfa93fa408ae
3 files changed