luci-lib-ip: fix netlink receiving in link()
[project/luci.git] / libs / luci-lib-ip / src / ip.c
index c799419..5bff693 100644 (file)
@@ -1270,7 +1270,9 @@ static int link_get(lua_State *L)
        lua_newtable(L);
 
        nl_send_auto_complete(sock, msg);
        lua_newtable(L);
 
        nl_send_auto_complete(sock, msg);
-       nl_recvmsgs(sock, cb);
+
+       while (st.pending > 0)
+               nl_recvmsgs(sock, cb);
 
        nlmsg_free(msg);
        nl_cb_put(cb);
 
        nlmsg_free(msg);
        nl_cb_put(cb);