diff options
| author | Sreeram Ramachandran <sreeram@google.com> | 2014-07-11 11:45:14 -0700 |
|---|---|---|
| committer | Sreeram Ramachandran <sreeram@google.com> | 2014-07-11 13:05:56 -0700 |
| commit | bb40d5198943df0e2a88514cbcd82a23a5b0cd97 (patch) | |
| tree | 9e97f40ad2a050e2ad64168bae7c2dd0c5b97e85 /server/RouteController.cpp | |
| parent | c7d804c1d22db40ac79fde46a032cd359e975f5b (diff) | |
Add default routing tables to rt_tables.
This is so that these tables also get dumped by bugreport / dumpstate.
Change-Id: Ia5ed8a23911d7b34ba964934dec42849f4a73824
Diffstat (limited to 'server/RouteController.cpp')
| -rw-r--r-- | server/RouteController.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/RouteController.cpp b/server/RouteController.cpp index d33c47cb..0b6a50c4 100644 --- a/server/RouteController.cpp +++ b/server/RouteController.cpp @@ -57,6 +57,9 @@ const uint32_t ROUTE_TABLE_LEGACY_SYSTEM = 99; const char* const ROUTE_TABLE_NAME_LEGACY_NETWORK = "legacy_network"; const char* const ROUTE_TABLE_NAME_LEGACY_SYSTEM = "legacy_system"; +const char* const ROUTE_TABLE_NAME_LOCAL = "local"; +const char* const ROUTE_TABLE_NAME_MAIN = "main"; + // TODO: These values aren't defined by the Linux kernel, because our UID routing changes are not // upstream (yet?), so we can't just pick them up from kernel headers. When (if?) the changes make // it upstream, we'll remove this and rely on the kernel header values. For now, add a static assert @@ -140,8 +143,13 @@ void addTableName(uint32_t table, const std::string& name, std::string* contents // Doesn't return success/failure as the file is optional; it's okay if we fail to update it. void updateTableNamesFile() { std::string contents; + + addTableName(RT_TABLE_LOCAL, ROUTE_TABLE_NAME_LOCAL, &contents); + addTableName(RT_TABLE_MAIN, ROUTE_TABLE_NAME_MAIN, &contents); + addTableName(ROUTE_TABLE_LEGACY_NETWORK, ROUTE_TABLE_NAME_LEGACY_NETWORK, &contents); addTableName(ROUTE_TABLE_LEGACY_SYSTEM, ROUTE_TABLE_NAME_LEGACY_SYSTEM, &contents); + for (const auto& entry : interfaceToTable) { addTableName(entry.second, entry.first, &contents); } |
