[ELR#3] Create <iface>_local table to place the local routes
The new local exclusion rules for the VPN networks will be in
the new set of rules above BYPASSABLE_VPN_LOCAL_EXCLUSION for
the local exclusion VPN network. The rules for the local IP
rules will need to be in new tables separated from the existing
interfaces tables. Create <iface>_local table based on the
existing interfaces.
The new routing table will only be written in the rt_tables
instead of open a new device in /dev since it's only required
for supporting routing, such as legacy_network or legacy_system
tables. The new <iface>_local tables share the same life time
of the specific interface tables which means these new tables
will also be removed when the specific interfaces tables are
gone.
These new tables are unfunctional now but only created in the
rt_tables for the mapping between interface name and the index.
Sample content in rt_table before the patch:
255 local
254 main
97 local_network
98 legacy_network
99 legacy_system
1003 dummy0
1010 rmnet_data0
Sample content in the rt_table after the patch:
255 local
254 main
97 local_network
98 legacy_network
99 legacy_system
1003 dummy0
1000000003 dummy0_local
1010 rmnet_data0
1000000010 rmnet_data0_local
Bug: 184750836
Test: cd system/netd ; atest
Change-Id: I13e1efa73a7145c22970880d8b72cbbd7366276c
3 files changed