diff --git a/netinterface.py b/netinterface.py index 729221d9..abdfc9c4 100644 --- a/netinterface.py +++ b/netinterface.py @@ -214,13 +214,17 @@ def writeRHStyleInterface(self, iface): def waitUntilUp(self, iface): - if not self.isStatic4(): - return True - if not self.gateway: - return True + iface_name = self.getInterfaceName(iface) + if self.isStatic4() and self.gateway: + rc = util.runCmd2(['/usr/sbin/arping', '-f', '-w', '120', '-I', + iface_name, self.gateway]) + if rc != 0: + return False + + if self.isStatic6() and self.ipv6_gateway: + rc = util.runCmd2(['/usr/sbin/ndisc6', '-1', '-w', '120', + self.ipv6_gateway, iface_name]) - rc = util.runCmd2(['/usr/sbin/arping', '-f', '-w', '120', '-I', - self.getInterfaceName(iface), self.gateway]) return rc == 0 @staticmethod