It seems that there is a race, at least in 10.13, that lets
if_indextoname() fail for the new TUN device. So we delay the call a bit,
which seems to "fix" the issue. It's strange anyway that the previous
delay was only applied when an iface entry was already found.
.flags = msg->ifm_flags,
.addrs = linked_list_create(),
);
+#ifdef __APPLE__
+ /* Similar to the issue described above, on 10.13 we need this delay as
+ * we might otherwise not be able to convert the index to a name yet. */
+ usleep(50000);
+#endif
if (if_indextoname(iface->ifindex, iface->ifname))
{
DBG1(DBG_KNL, "interface %s appeared", iface->ifname);