Skip to content

Commit 5c58298

Browse files
dlunevDavid S. Miller
authored andcommitted
[NETLINK]: Fix ACK processing after netlink_dump_start
Revert to original netlink behavior. Do not reply with ACK if the netlink dump has bees successfully started. libnl has been broken by the cd40b7d The following command reproduce the problem: /nl-route-get 192.168.1.1 Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent be7f827 commit 5c58298

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

net/netlink/af_netlink.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,11 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
15651565

15661566
netlink_dump(sk);
15671567
sock_put(sk);
1568-
return 0;
1568+
1569+
/* We successfully started a dump, by returning -EINTR we
1570+
* signal not to send ACK even if it was requested.
1571+
*/
1572+
return -EINTR;
15691573
}
15701574

15711575
void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
@@ -1619,17 +1623,21 @@ int netlink_rcv_skb(struct sk_buff *skb, int (*cb)(struct sk_buff *,
16191623

16201624
/* Only requests are handled by the kernel */
16211625
if (!(nlh->nlmsg_flags & NLM_F_REQUEST))
1622-
goto skip;
1626+
goto ack;
16231627

16241628
/* Skip control messages */
16251629
if (nlh->nlmsg_type < NLMSG_MIN_TYPE)
1626-
goto skip;
1630+
goto ack;
16271631

16281632
err = cb(skb, nlh);
1629-
skip:
1633+
if (err == -EINTR)
1634+
goto skip;
1635+
1636+
ack:
16301637
if (nlh->nlmsg_flags & NLM_F_ACK || err)
16311638
netlink_ack(skb, nlh, err);
16321639

1640+
skip:
16331641
msglen = NLMSG_ALIGN(nlh->nlmsg_len);
16341642
if (msglen > skb->len)
16351643
msglen = skb->len;

0 commit comments

Comments
 (0)