netifd : Disable netlink auto ack
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 11 Feb 2014 08:29:36 +0000 (08:29 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 14 Feb 2014 19:56:21 +0000 (20:56 +0100)
Disable netlink auto ack when doing a delete in the get callback
handler to avoid race conditions resulting into stalled message
on the netlink socket.

Solves issue reported in https://dev.openwrt.org/ticket/14590

Signed-off-by: Karl Vogel <karl.vogel@gmail.com>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
system-linux.c

index db78240a59662de9ee548d830ad5ac04fe81a0a9..e1b992486ca54f5769b126c3e89f7d29be957c7b 100644 (file)
@@ -456,8 +456,9 @@ static int cb_clear_event(struct nl_msg *msg, void *arg)
        hdr->nlmsg_type = type;
        hdr->nlmsg_flags = NLM_F_REQUEST;
 
-       if (!nl_send_auto_complete(sock_rtnl, clr->msg))
-               nl_wait_for_ack(sock_rtnl);
+       nl_socket_disable_auto_ack(sock_rtnl);
+       nl_send_auto_complete(sock_rtnl, clr->msg);
+       nl_socket_enable_auto_ack(sock_rtnl);
 
        return NL_SKIP;
 }