From 203414910fc07786821a11067b0397d3d3544707 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 8 Jul 2019 12:33:26 -0700 Subject: [PATCH] Give up to a second for the interface to appear to assign IP addresses --- osdep/LinuxNetLink.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osdep/LinuxNetLink.cpp b/osdep/LinuxNetLink.cpp index 6645a8565..a276b4073 100644 --- a/osdep/LinuxNetLink.cpp +++ b/osdep/LinuxNetLink.cpp @@ -850,6 +850,10 @@ void LinuxNetLink::addAddress(const InetAddress &addr, const char *iface) #endif int interface_index = _indexForInterface(iface); + for (int reps = 0; interface_index == -1 && reps < 10; ++reps) { + Thread::sleep(100); + interface_index == _indexForInterface(iface); + } if (interface_index == -1) { fprintf(stderr, "Unable to find index for interface %s\n", iface);