Skip to content

Commit 372953d

Browse files
bn222mlguerrero12
authored andcommitted
Ignore settling with down state since it will never settle
Signed-off-by: Balazs Nemeth <[email protected]>
1 parent 85daca7 commit 372953d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/ip/addr_linux.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,16 @@ func SettleAddresses(ifName string, timeout time.Duration) error {
6666
return nil
6767
}
6868
if time.Now().After(deadline) {
69-
return fmt.Errorf("link %s still has tentative addresses after %d seconds",
70-
ifName,
71-
timeout)
69+
link, err := netlinksafe.LinkByName(ifName)
70+
if err != nil {
71+
return fmt.Errorf("failed to retrieve link: %v", err)
72+
}
73+
if link.Attrs().OperState == netlink.OperUp {
74+
return fmt.Errorf("link %s still has tentative addresses after %d seconds",
75+
ifName,
76+
timeout)
77+
}
78+
return nil
7279
}
7380

7481
time.Sleep(SETTLE_INTERVAL)

0 commit comments

Comments
 (0)