summaryrefslogtreecommitdiff
path: root/server/RouteControllerTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ELR#3] Create <iface>_local table to place the local routesChiachang Wang2022-01-251-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use route priority only for route cache invalidationTaras Antoshchuk2021-10-111-12/+9
| | | | | | | | | | | | | | | For routes cache invalidation we add and remove default throw routes with low priority. Initial implementation set low priority for all default throw routes, which didn't matter at the time, since throw routes were not commonly used. Now, throw routes are going to become more common (e.g. used in VPN routing tables). This CL makes sure we only set low priority on default throw routes if they are used for route cache invalidation. Bug: 186082280 Test: atest NetdBinderTest Change-Id: I4d457152c4177528ca9766a7909bc3ee51319a33
* Move IP rule priorities to header fileKen Chen2021-01-121-4/+4
| | | | | | | Make constants visible for tests, rather than have copies. Test: atest Change-Id: Ibb70ae5c719e174ace4278d617564dfd48d1455d
* netd: Route MTUTyler Wear2020-01-231-6/+12
| | | | | | | | | | - Route may include optional MTU parameter - Change route is added so routes don't need to be deleted then re-added - Add/Del/Change functions to pass route info as parcel Bug: 142892223 Test: new unit tests Change-Id: Idc32ecb0520b1f4136b3fe0e3f7b6800fb3005a6
* Modernize codebase by replacing NULL with nullptrYi Kong2018-07-251-6/+6
| | | | | | | | Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I226a0599db4f7c3557e55cade7869d00bd314949
* Merge changes Icc35c917,I12899e03,Iff5a202cLorenzo Colitti2018-01-101-0/+4
|\ | | | | | | | | | | | | * changes: Tighten up locking in NetworkController. Add locking to RouteController. Change RouteController from free functions/members to class functions.
| * Change RouteController from free functions/members to class functions.Lorenzo Colitti2017-11-241-0/+4
| | | | | | | | | | | | | | | | In a future change, this will make it more explicit which bits of state (e.g., locks) are part of the class and which are not. Test: netd_{unit,integration}_test passes Change-Id: Iff5a202cdcb26a7b6039dd95655cc2c26592fc36
* | [ipsec-qtaguid] Reserve mark, add ipsec bw exemptionsBenedict Wong2017-12-151-8/+21
|/ | | | | | | | | | | | This change reserves a mark denoting that a packet has already been accounted for, along with adding rules in BandwidthController to support IPSec packets being billed correctly. Bug: 62994731 Test: BandwidthControllerTest updated, passing. CTS tests also modified and passing Change-Id: I8b42975d1502a0d3b9e533bddc0892cfe1556bed
* Clear incoming packet mark rules on netd startup.Lorenzo Colitti2017-03-281-2/+4
| | | | | | | | | | | | | | | Currently, we put the incoming packet mark rules directly into the INPUT chain of the mangle table, which is not cleared on netd start. Move these rules to their own chain. This makes them consistent with all the other iptables rules and makes it easy to clear them on startup using the existing mechanisms. Bug: 28362720 Test: bullhead builds, boots Test: netd_{unit,integration}_test pass Test: watch -n1 "adb shell iptables -v -n -t mangle -L INPUT" while switching networks Test: rules are cleared on netd restart Change-Id: I9130f997a96dcfdfdfdd950520a76f8473b5f603
* Use iptables-restore to set the incoming packet mark rule.Lorenzo Colitti2017-03-271-2/+19
| | | | | | | | | | | This speeds up network switching because one rule needs to be added/removed per interface. Bug: 28362720 Test: bullhead builds, boots Test: netd_{unit,integration}_test pass Test: watch -n1 "adb shell iptables -v -n -t mangle -L INPUT" while switching networks Change-Id: Ie536db6a50d018c88bb03c5f069965e99e0d162e
* Add a test for RouteController.Lorenzo Colitti2017-02-161-0/+80
Test: netd_{unit,integration}_test pass. Change-Id: I19416fd8a79354303dabec042d090f7ae6962b1b