Skip to content

Commit

Permalink
waitUntilUp also wait for IPv6 if statically configured
Browse files Browse the repository at this point in the history
Need to add `ndisc6` to the install.img

Signed-off-by: BenjiReis <[email protected]>
  • Loading branch information
benjamreis committed Jun 15, 2023
1 parent dc98631 commit b9c449d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions netinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,18 @@ def writeRHStyleInterface(self, iface):


def waitUntilUp(self, iface):
if not self.isStatic4():
return True
if not self.gateway:
return True

rc = util.runCmd2(['/usr/sbin/arping', '-f', '-w', '120', '-I',
self.getInterfaceName(iface), self.gateway])
return rc == 0
iface_name = self.getInterfaceName(iface)
if self.isStatic4() and self.gateway and util.runCmd2(
['/usr/sbin/arping', '-f', '-w', '120', '-I', iface_name, self.gateway]
):
return False

if self.isStatic6() and self.ipv6_gateway and util.runCmd2(
['/usr/sbin/ndisc6', '-1', '-w', '120', self.ipv6_gateway, iface_name]
):
return False

return True

@staticmethod
def getModeStr(mode):
Expand Down

0 comments on commit b9c449d

Please sign in to comment.