Commit 5c58298c authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[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 cd40b7d3
The following command reproduce the problem:
   /nl-route-get 192.168.1.1
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Acked-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be7f8273
...@@ -1565,7 +1565,11 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, ...@@ -1565,7 +1565,11 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
netlink_dump(sk); netlink_dump(sk);
sock_put(sk); sock_put(sk);
return 0;
/* We successfully started a dump, by returning -EINTR we
* signal not to send ACK even if it was requested.
*/
return -EINTR;
} }
void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err) 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 *, ...@@ -1619,17 +1623,21 @@ int netlink_rcv_skb(struct sk_buff *skb, int (*cb)(struct sk_buff *,
/* Only requests are handled by the kernel */ /* Only requests are handled by the kernel */
if (!(nlh->nlmsg_flags & NLM_F_REQUEST)) if (!(nlh->nlmsg_flags & NLM_F_REQUEST))
goto skip; goto ack;
/* Skip control messages */ /* Skip control messages */
if (nlh->nlmsg_type < NLMSG_MIN_TYPE) if (nlh->nlmsg_type < NLMSG_MIN_TYPE)
goto skip; goto ack;
err = cb(skb, nlh); err = cb(skb, nlh);
skip: if (err == -EINTR)
goto skip;
ack:
if (nlh->nlmsg_flags & NLM_F_ACK || err) if (nlh->nlmsg_flags & NLM_F_ACK || err)
netlink_ack(skb, nlh, err); netlink_ack(skb, nlh, err);
skip:
msglen = NLMSG_ALIGN(nlh->nlmsg_len); msglen = NLMSG_ALIGN(nlh->nlmsg_len);
if (msglen > skb->len) if (msglen > skb->len)
msglen = skb->len; msglen = skb->len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment