]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nfnl_osf: Fix broken conversion to nfnl_query()
authorPhil Sutter <phil@nwl.cc>
Sat, 9 May 2020 11:36:49 +0000 (13:36 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 18 May 2020 15:27:20 +0000 (17:27 +0200)
Due to missing NLM_F_ACK flag in request, nfnetlink code in kernel
didn't create an own ACK message but left it upon subsystem to ACK or
not. Since nfnetlink_osf doesn't ACK by itself, nfnl_query() got stuck
waiting for a reply.

Whoever did the conversion from deprecated nfnl_talk() obviously didn't
even test basic functionality of the tool.

Fixes: 52aa15098ebd6 ("nfnl_osf: Replace deprecated nfnl_talk() by nfnl_query()")
Signed-off-by: Phil Sutter <phil@nwl.cc>
utils/nfnl_osf.c

index 15d531975e11d073dad690f1e120e365ab6f1cc6..922d90ac135b772dcf5e0f2298743a82fdd7734d 100644 (file)
@@ -378,9 +378,11 @@ static int osf_load_line(char *buffer, int len, int del)
        memset(buf, 0, sizeof(buf));
 
        if (del)
-               nfnl_fill_hdr(nfnlssh, nmh, 0, AF_UNSPEC, 0, OSF_MSG_REMOVE, NLM_F_REQUEST);
+               nfnl_fill_hdr(nfnlssh, nmh, 0, AF_UNSPEC, 0, OSF_MSG_REMOVE,
+                             NLM_F_ACK | NLM_F_REQUEST);
        else
-               nfnl_fill_hdr(nfnlssh, nmh, 0, AF_UNSPEC, 0, OSF_MSG_ADD, NLM_F_REQUEST | NLM_F_CREATE);
+               nfnl_fill_hdr(nfnlssh, nmh, 0, AF_UNSPEC, 0, OSF_MSG_ADD,
+                             NLM_F_ACK | NLM_F_REQUEST | NLM_F_CREATE);
 
        nfnl_addattr_l(nmh, sizeof(buf), OSF_ATTR_FINGER, &f, sizeof(struct xt_osf_user_finger));