@@ -33,6 +33,7 @@
#include <asm/types.h>
#include <misc/debug.h>
+#include <misc/nonblocking.h>
#include <ncd/NCDInterfaceMonitor.h>
@@ -150,6 +151,12 @@ int NCDInterfaceMonitor_Init (NCDInterfaceMonitor *o, BReactor *reactor, NCDInte
goto fail0;
}
+ // set fd non-blocking
+ if (!badvpn_set_nonblocking(o->netlink_fd)) {
+ DEBUG("badvpn_set_nonblocking failed");
+ goto fail1;
+ }
+
// bind netlink fd
struct sockaddr_nl sa;
memset(&sa, 0, sizeof(sa));