diff options
author | Grant Limberg <grant.limberg@zerotier.com> | 2019-07-08 12:33:26 -0700 |
---|---|---|
committer | Grant Limberg <grant.limberg@zerotier.com> | 2019-07-08 12:33:26 -0700 |
commit | 203414910fc07786821a11067b0397d3d3544707 (patch) | |
tree | 0630af966fa29b477c91df593b2acd59106c6fe1 | |
parent | dffbd2113a9c6fffa273b21fc4628d2440b68410 (diff) | |
download | infinitytier-203414910fc07786821a11067b0397d3d3544707.tar.gz infinitytier-203414910fc07786821a11067b0397d3d3544707.zip |
Give up to a second for the interface to appear to assign IP addresses
-rw-r--r-- | osdep/LinuxNetLink.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/osdep/LinuxNetLink.cpp b/osdep/LinuxNetLink.cpp index 6645a856..a276b407 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); |