diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-03-16 09:30:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-20 17:29:03 -0400 |
commit | 37b7ef7203240b3aba577bb1ff6765fe15225976 (patch) | |
tree | 6e54b06dd07adff6e1ea52caf6715eca905dbb9a /net | |
parent | 1a50307ba1826e4da0024e64b245ce4eadf7688a (diff) |
netfilter: ctnetlink: fix reliable event delivery if message building fails
This patch fixes a bug that allows to lose events when reliable
event delivery mode is used, ie. if NETLINK_BROADCAST_SEND_ERROR
and NETLINK_RECV_NO_ENOBUFS socket options are set.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 4 | ||||
-rw-r--r-- | net/netfilter/nfnetlink.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 2b2af631d2b8..569410a85953 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -582,7 +582,9 @@ nla_put_failure: | |||
582 | nlmsg_failure: | 582 | nlmsg_failure: |
583 | kfree_skb(skb); | 583 | kfree_skb(skb); |
584 | errout: | 584 | errout: |
585 | nfnetlink_set_err(net, 0, group, -ENOBUFS); | 585 | if (nfnetlink_set_err(net, 0, group, -ENOBUFS) > 0) |
586 | return -ENOBUFS; | ||
587 | |||
586 | return 0; | 588 | return 0; |
587 | } | 589 | } |
588 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ | 590 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 8eb0cc23ada3..6afa3d52ea5f 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -113,9 +113,9 @@ int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, | |||
113 | } | 113 | } |
114 | EXPORT_SYMBOL_GPL(nfnetlink_send); | 114 | EXPORT_SYMBOL_GPL(nfnetlink_send); |
115 | 115 | ||
116 | void nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error) | 116 | int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error) |
117 | { | 117 | { |
118 | netlink_set_err(net->nfnl, pid, group, error); | 118 | return netlink_set_err(net->nfnl, pid, group, error); |
119 | } | 119 | } |
120 | EXPORT_SYMBOL_GPL(nfnetlink_set_err); | 120 | EXPORT_SYMBOL_GPL(nfnetlink_set_err); |
121 | 121 | ||