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

Commit a71996fc authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Patrick McHardy
Browse files

netfilter: netns nf_conntrack: pass conntrack to nf_conntrack_event_cache() not skb



This is cleaner, we already know conntrack to which event is relevant.

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 678d6675
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -28,10 +28,8 @@ extern void __nf_ct_event_cache_init(struct nf_conn *ct);
extern void nf_ct_event_cache_flush(void);

static inline void
nf_conntrack_event_cache(enum ip_conntrack_events event,
			 const struct sk_buff *skb)
nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
{
	struct nf_conn *ct = (struct nf_conn *)skb->nfct;
	struct nf_conntrack_ecache *ecache;

	local_bh_disable();
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ static int icmp_packet(struct nf_conn *ct,
			nf_ct_kill_acct(ct, ctinfo, skb);
	} else {
		atomic_inc(&ct->proto.icmp.count);
		nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, skb);
		nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, ct);
		nf_ct_refresh_acct(ct, ctinfo, skb, nf_ct_icmp_timeout);
	}

+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ nf_nat_mangle_tcp_packet(struct sk_buff *skb,
		nf_conntrack_tcp_update(skb, ip_hdrlen(skb),
					ct, CTINFO2DIR(ctinfo));

		nf_conntrack_event_cache(IPCT_NATSEQADJ, skb);
		nf_conntrack_event_cache(IPCT_NATSEQADJ, ct);
	}
	return 1;
}
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ static int icmpv6_packet(struct nf_conn *ct,
			nf_ct_kill_acct(ct, ctinfo, skb);
	} else {
		atomic_inc(&ct->proto.icmp.count);
		nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, skb);
		nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, ct);
		nf_ct_refresh_acct(ct, ctinfo, skb, nf_ct_icmpv6_timeout);
	}

+5 −5
Original line number Diff line number Diff line
@@ -370,14 +370,14 @@ __nf_conntrack_confirm(struct sk_buff *skb)
	spin_unlock_bh(&nf_conntrack_lock);
	help = nfct_help(ct);
	if (help && help->helper)
		nf_conntrack_event_cache(IPCT_HELPER, skb);
		nf_conntrack_event_cache(IPCT_HELPER, ct);
#ifdef CONFIG_NF_NAT_NEEDED
	if (test_bit(IPS_SRC_NAT_DONE_BIT, &ct->status) ||
	    test_bit(IPS_DST_NAT_DONE_BIT, &ct->status))
		nf_conntrack_event_cache(IPCT_NATINFO, skb);
		nf_conntrack_event_cache(IPCT_NATINFO, ct);
#endif
	nf_conntrack_event_cache(master_ct(ct) ?
				 IPCT_RELATED : IPCT_NEW, skb);
				 IPCT_RELATED : IPCT_NEW, ct);
	return NF_ACCEPT;

out:
@@ -740,7 +740,7 @@ nf_conntrack_in(struct net *net, u_int8_t pf, unsigned int hooknum,
	}

	if (set_reply && !test_and_set_bit(IPS_SEEN_REPLY_BIT, &ct->status))
		nf_conntrack_event_cache(IPCT_STATUS, skb);
		nf_conntrack_event_cache(IPCT_STATUS, ct);

	return ret;
}
@@ -853,7 +853,7 @@ void __nf_ct_refresh_acct(struct nf_conn *ct,

	/* must be unlocked when calling event cache */
	if (event)
		nf_conntrack_event_cache(event, skb);
		nf_conntrack_event_cache(event, ct);
}
EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct);

Loading