Fix tethering in the case of a regular upstream connection.
Fixes tethering via Ethernet, Bluetooth and WiFi (hotspot).
Tethering when the upstream has a DUN-specific APN is likely still broken
(untested).
For now, assign a fixed NetId (a hack) until we can change the framework to
create a valid NetworkAgent and all that jazz.
Bug: 15968336
Bug: 14988803
Change-Id: Idcf4d492d9329a9c87913e27be6dd835a792bea2
diff --git a/server/NetworkController.h b/server/NetworkController.h
index 217dfbc..f0a5ea7 100644
--- a/server/NetworkController.h
+++ b/server/NetworkController.h
@@ -52,6 +52,10 @@
unsigned getNetworkForUser(uid_t uid, unsigned requestedNetId, bool forDns) const;
unsigned getNetworkForInterface(const char* interface) const;
+ // TODO: Remove this hack.
+ unsigned getNetIdForLocalNetwork() const;
+
+ int createLocalNetwork(unsigned netId) WARN_UNUSED_RESULT;
int createPhysicalNetwork(unsigned netId, Permission permission) WARN_UNUSED_RESULT;
int createVirtualNetwork(unsigned netId, bool hasDns) WARN_UNUSED_RESULT;
int destroyNetwork(unsigned netId) WARN_UNUSED_RESULT;