aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2007-10-23 23:29:25 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-24 00:27:51 -0400
commit5c58298c2536252ab95aa2b1497ab47eb878ca5d (patch)
treec21815b2b3c16aaf7ebb5750fe4fe195f1d04e3c /net/netlink
parentbe7f827360b5dfecd8f43adbd48f2c39556004c9 (diff)
[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 cd40b7d3983c708aabe3d3008ec64ffce56d33b0 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>
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/af_netlink.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 98e313e5e594..325272925d0f 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1565,7 +1565,11 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1565 1565
1566 netlink_dump(sk); 1566 netlink_dump(sk);
1567 sock_put(sk); 1567 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;
1569} 1573}
1570 1574
1571void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err) 1575void 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 1623
1620 /* Only requests are handled by the kernel */ 1624 /* Only requests are handled by the kernel */
1621 if (!(nlh->nlmsg_flags & NLM_F_REQUEST)) 1625 if (!(nlh->nlmsg_flags & NLM_F_REQUEST))
1622 goto skip; 1626 goto ack;
1623 1627
1624 /* Skip control messages */ 1628 /* Skip control messages */
1625 if (nlh->nlmsg_type < NLMSG_MIN_TYPE) 1629 if (nlh->nlmsg_type < NLMSG_MIN_TYPE)
1626 goto skip; 1630 goto ack;
1627 1631
1628 err = cb(skb, nlh); 1632 err = cb(skb, nlh);
1629skip: 1633 if (err == -EINTR)
1634 goto skip;
1635
1636ack:
1630 if (nlh->nlmsg_flags & NLM_F_ACK || err) 1637 if (nlh->nlmsg_flags & NLM_F_ACK || err)
1631 netlink_ack(skb, nlh, err); 1638 netlink_ack(skb, nlh, err);
1632 1639
1640skip:
1633 msglen = NLMSG_ALIGN(nlh->nlmsg_len); 1641 msglen = NLMSG_ALIGN(nlh->nlmsg_len);
1634 if (msglen > skb->len) 1642 if (msglen > skb->len)
1635 msglen = skb->len; 1643 msglen = skb->len;