提交 a83099a6 编写于 作者: E Eric Leblond 提交者: David S. Miller

[NETFILTER]: nf_conntrack_netlink: transmit mark during all events

The following feature was submitted some months ago. It forces the dump
of mark during the connection destruction event. The induced load is
quiet small and the patch is usefull to provide an easy way to filter
event on user side without having to keep an hash in userspace.
Signed-off-by: NEric Leblond <eric@inl.fr>
Signed-off-by: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1f807d6e
...@@ -491,11 +491,6 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, ...@@ -491,11 +491,6 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
&& ctnetlink_dump_helpinfo(skb, ct) < 0) && ctnetlink_dump_helpinfo(skb, ct) < 0)
goto nla_put_failure; goto nla_put_failure;
#ifdef CONFIG_NF_CONNTRACK_MARK
if ((events & IPCT_MARK || ct->mark)
&& ctnetlink_dump_mark(skb, ct) < 0)
goto nla_put_failure;
#endif
#ifdef CONFIG_NF_CONNTRACK_SECMARK #ifdef CONFIG_NF_CONNTRACK_SECMARK
if ((events & IPCT_SECMARK || ct->secmark) if ((events & IPCT_SECMARK || ct->secmark)
&& ctnetlink_dump_secmark(skb, ct) < 0) && ctnetlink_dump_secmark(skb, ct) < 0)
...@@ -516,6 +511,12 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, ...@@ -516,6 +511,12 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
goto nla_put_failure; goto nla_put_failure;
} }
#ifdef CONFIG_NF_CONNTRACK_MARK
if ((events & IPCT_MARK || ct->mark)
&& ctnetlink_dump_mark(skb, ct) < 0)
goto nla_put_failure;
#endif
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
nfnetlink_send(skb, 0, group, 0); nfnetlink_send(skb, 0, group, 0);
return NOTIFY_DONE; return NOTIFY_DONE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册