Give up to a second for the interface to appear to assign IP addresses

This commit is contained in:
Grant Limberg 2019-07-08 12:33:26 -07:00
parent dffbd2113a
commit 203414910f

View File

@ -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);