From: Vincent Bernat Date: Mon, 10 Jun 2019 09:17:52 +0000 (+0200) Subject: netlink: make the netlink socket totally non blocking X-Git-Tag: 1.0.4~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66a551ed239da9b9cf9d47d471f07c702e72e9cc;p=thirdparty%2Flldpd.git netlink: make the netlink socket totally non blocking See #333. --- diff --git a/src/daemon/event.c b/src/daemon/event.c index a82c19e8..0963c1ef 100644 --- a/src/daemon/event.c +++ b/src/daemon/event.c @@ -756,8 +756,7 @@ levent_iface_subscribe(struct lldpd *cfg, int socket) { log_debug("event", "subscribe to interface changes from socket %d", socket); - if (cfg->g_iface_cb == NULL) - levent_make_socket_nonblocking(socket); + levent_make_socket_nonblocking(socket); cfg->g_iface_event = event_new(cfg->g_base, socket, EV_READ | EV_PERSIST, levent_iface_recv, cfg); if (cfg->g_iface_event == NULL) { diff --git a/src/daemon/netlink.c b/src/daemon/netlink.c index d3e26dec..c89e1490 100644 --- a/src/daemon/netlink.c +++ b/src/daemon/netlink.c @@ -472,7 +472,7 @@ netlink_recv(struct lldpd *cfg, }; flags = MSG_PEEK | MSG_TRUNC; retry: - len = recvmsg(s, &rtnl_reply, flags | MSG_DONTWAIT); + len = recvmsg(s, &rtnl_reply, flags); if (len == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) { if (retry++ == 0) {