Increase the valid name of the iface to IFNAMSIZ
Define MAX_IFACE_LENGTH as IFNAMSIZ instead of 10, to
prevent netd from treating an interface name 'rmnet_sdio0'
as invalid.
Also fix an off-by-one error.
bug:5675718
Change-Id: I2b6ba823c89941031e5898b24dab388cd9c2dae8
diff --git a/NatController.cpp b/NatController.cpp
index 7f1bc60..4ea5d24 100644
--- a/NatController.cpp
+++ b/NatController.cpp
@@ -89,7 +89,7 @@
}
bool NatController::checkInterface(const char *iface) {
- if (strlen(iface) > MAX_IFACE_LENGTH) return false;
+ if (strlen(iface) > IFNAMSIZ) return false;
return true;
}