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 <benjamin.reis@vates.fr>
  • Loading branch information
benjamreis committed Jun 5, 2023
1 parent 3c6200f commit 759b98b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions netinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 759b98b

Please sign in to comment.