Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e57dce60 authored by Fabian Hugelshofer's avatar Fabian Hugelshofer Committed by David S. Miller
Browse files

netfilter: ctnetlink: include conntrack status in destroy event message



When a conntrack is destroyed, the connection status does not get
exported to netlink. I don't see a reason for not doing so. This patch
exports the status on all conntrack events.

Signed-off-by: default avatarFabian Hugelshofer <hugelshofer2006@gmx.ch>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 718d4ad9
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -475,14 +475,14 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
	if (ctnetlink_dump_id(skb, ct) < 0)
	if (ctnetlink_dump_id(skb, ct) < 0)
		goto nla_put_failure;
		goto nla_put_failure;


	if (ctnetlink_dump_status(skb, ct) < 0)
		goto nla_put_failure;

	if (events & IPCT_DESTROY) {
	if (events & IPCT_DESTROY) {
		if (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
		if (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
		    ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0)
		    ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0)
			goto nla_put_failure;
			goto nla_put_failure;
	} else {
	} else {
		if (ctnetlink_dump_status(skb, ct) < 0)
			goto nla_put_failure;

		if (ctnetlink_dump_timeout(skb, ct) < 0)
		if (ctnetlink_dump_timeout(skb, ct) < 0)
			goto nla_put_failure;
			goto nla_put_failure;