diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-03-29 21:28:23 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 16:02:09 -0700 |
commit | 5dda8d1fc44f3ab37c0e5c8e980254b6703ef8b2 (patch) | |
tree | 429776be32aa4eb465acfac71d908c5f5905b386 /net | |
parent | 9e9b5dce350fd6f34c2c6b7440951481fb594a29 (diff) |
netfilter: ctnetlink: fix reliable event delivery if message building fails
[ Upstream commit 37b7ef7203240b3aba577bb1ff6765fe15225976 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 3 | ||||
-rw-r--r-- | net/netfilter/nfnetlink.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 0ffe689dfe97..eeac97fcef79 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -571,7 +571,8 @@ nla_put_failure: nlmsg_failure: kfree_skb(skb); errout: - nfnetlink_set_err(0, group, -ENOBUFS); + if (nfnetlink_set_err(0, group, -ENOBUFS) > 0) + return -ENOBUFS; return 0; } #endif /* CONFIG_NF_CONNTRACK_EVENTS */ diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index eedc0c1ac7a4..35fe185316e7 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c @@ -114,9 +114,9 @@ int nfnetlink_send(struct sk_buff *skb, u32 pid, } EXPORT_SYMBOL_GPL(nfnetlink_send); -void nfnetlink_set_err(u32 pid, u32 group, int error) +int nfnetlink_set_err(u32 pid, u32 group, int error) { - netlink_set_err(nfnl, pid, group, error); + return netlink_set_err(nfnl, pid, group, error); } EXPORT_SYMBOL_GPL(nfnetlink_set_err); |