summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKen Chen <cken@google.com>2023-08-24 18:39:26 +0800
committerKen Chen <cken@google.com>2023-09-01 07:26:31 +0800
commitd81356cd0f24c2f8b42fe1a9666130f65ae33af1 (patch)
treeed26373da9989ccbbde57fd71c32d67aadc238c3 /include
parentedc647f2daf72dbca7a9edfd599ae3efbc0a1f6b (diff)
downloadnetd-d81356cd0f24c2f8b42fe1a9666130f65ae33af1.tar.gz
Mark V6 link-local sockets correctly
The fwmark.netId of the link-local sockets is wrong. FwmarkServer uses the current default network on connect() if no network is specified, which can be mobile data or wifi. Netd would incorrectly destroy link-local sockets when the default network's permission is changed, since the socket destroy relies on the fwmark.netId. This change remarks the V6 link-local sockets on connect() based on the scope id of the destination address. Bug: 291128241 Test: atest netd_integration_test:NetdBinderTest#V6LinkLocalFwmark Test: Manually test backup and restore with following steps on the source devie. 1. Run backup and restore with mobile data + wifi. 2. B&R will disconnect device from wifi AP to get full speed. 3. Plays videos on Youtube when data is copying. 4. Screen off for a while. 5. Screen on, the wifi is automatically connected. 6. Wait 30s and the mobile data permission will be changed. 7. Wait for the data copy to completed. Change-Id: Ia461c669bdbfaebd5a1ae2e84e23c0c6cea75297
Diffstat (limited to 'include')
-rw-r--r--include/FwmarkCommand.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/FwmarkCommand.h b/include/FwmarkCommand.h
index 0ff2d2c8..73f98e11 100644
--- a/include/FwmarkCommand.h
+++ b/include/FwmarkCommand.h
@@ -29,7 +29,7 @@ struct FwmarkConnectInfo {
sockaddr s;
sockaddr_in sin;
sockaddr_in6 sin6;
- } addr;
+ } addr = {};
FwmarkConnectInfo() : error(0), latencyMs(0) {}