diff options
| author | Jimmy Chen <jimmycmchen@google.com> | 2019-03-08 16:12:55 +0800 |
|---|---|---|
| committer | Jimmy Chen <jimmycmchen@google.com> | 2019-03-08 16:39:28 +0800 |
| commit | ce9e5783ad1e6fd20bf38352ed9fdfcb8278f9f6 (patch) | |
| tree | 5bd984e65c71469aa7c0d31f0defa071c4afe580 /server/RouteController.cpp | |
| parent | 58275707e9caa74f47c9eca21390a53715e295e6 (diff) | |
IPv6: allow the same prefix routing entries for link local
Allowing creating multiple link-local routes in the same table, so we can make IPv6
work on all interfaces in the local_network table.
Bug: 126063997
Test: * enable hotspot & usb tethering
* use ping6 to verify link local in both side of hotspot/usb
tethering
Change-Id: Ibe897004bd72bc88744c4bbac44ca512c0482f3b
Diffstat (limited to 'server/RouteController.cpp')
| -rw-r--r-- | server/RouteController.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/RouteController.cpp b/server/RouteController.cpp index ad6f6a6a..d0ceefa2 100644 --- a/server/RouteController.cpp +++ b/server/RouteController.cpp @@ -418,6 +418,13 @@ WARN_UNUSED_RESULT int modifyIpRoute(uint16_t action, uint32_t table, const char }; uint16_t flags = (action == RTM_NEWROUTE) ? NETLINK_ROUTE_CREATE_FLAGS : NETLINK_REQUEST_FLAGS; + + // Allow creating multiple link-local routes in the same table, so we can make IPv6 + // work on all interfaces in the local_network table. + if (family == AF_INET6 && IN6_IS_ADDR_LINKLOCAL(reinterpret_cast<in6_addr*>(rawAddress))) { + flags &= ~NLM_F_EXCL; + } + int ret = sendNetlinkRequest(action, flags, iov, ARRAY_SIZE(iov), nullptr); if (ret) { ALOGE("Error %s route %s -> %s %s to table %u: %s", |
