Disable DAD for downstream interfaces when tethering

Bug: 30298058
Change-Id: If4cd1f2e2b782ff08d667eb065138c06559b3394
diff --git a/server/InterfaceController.cpp b/server/InterfaceController.cpp
index 4129c0f..eac4fbf 100644
--- a/server/InterfaceController.cpp
+++ b/server/InterfaceController.cpp
@@ -136,6 +136,14 @@
     return writeValueToPath(ipv6_proc_path, interface, "accept_dad", accept_dad);
 }
 
+int InterfaceController::setIPv6DadTransmits(const char *interface, const char *value) {
+    if (!isIfaceName(interface)) {
+        errno = ENOENT;
+        return -1;
+    }
+    return writeValueToPath(ipv6_proc_path, interface, "dad_transmits", value);
+}
+
 int InterfaceController::setIPv6PrivacyExtensions(const char *interface, const int on) {
     if (!isIfaceName(interface)) {
         errno = ENOENT;
diff --git a/server/InterfaceController.h b/server/InterfaceController.h
index 356cc5a..98c8b8f 100644
--- a/server/InterfaceController.h
+++ b/server/InterfaceController.h
@@ -24,6 +24,7 @@
     static int setEnableIPv6(const char *interface, const int on);
     static int setAcceptIPv6Ra(const char *interface, const int on);
     static int setAcceptIPv6Dad(const char *interface, const int on);
+    static int setIPv6DadTransmits(const char *interface, const char *value);
     static int setIPv6PrivacyExtensions(const char *interface, const int on);
     static int setIPv6NdOffload(char* interface, const int on);
     static int setMtu(const char *interface, const char *mtu);
diff --git a/server/TetherController.cpp b/server/TetherController.cpp
index 971104f..6617c6a 100644
--- a/server/TetherController.cpp
+++ b/server/TetherController.cpp
@@ -65,11 +65,15 @@
 bool configureForIPv6Router(const char *interface) {
     return (InterfaceController::setEnableIPv6(interface, 0) == 0)
             && (InterfaceController::setAcceptIPv6Ra(interface, 0) == 0)
+            && (InterfaceController::setAcceptIPv6Dad(interface, 0) == 0)
+            && (InterfaceController::setIPv6DadTransmits(interface, "0") == 0)
             && (InterfaceController::setEnableIPv6(interface, 1) == 0);
 }
 
 void configureForIPv6Client(const char *interface) {
     InterfaceController::setAcceptIPv6Ra(interface, 1);
+    InterfaceController::setAcceptIPv6Dad(interface, 1);
+    InterfaceController::setIPv6DadTransmits(interface, "1");
     InterfaceController::setEnableIPv6(interface, 0);
 }