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

Commit c88130bc authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: nf_conntrack: naming unification



Rename all "conntrack" variables to "ct" for more consistency and
avoiding some overly long lines.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 76eb9460
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ nf_ct_tuplehash_to_ctrack(const struct nf_conntrack_tuple_hash *hash)

/* Alter reply tuple (maybe alter helper). */
extern void
nf_conntrack_alter_reply(struct nf_conn *conntrack,
nf_conntrack_alter_reply(struct nf_conn *ct,
			 const struct nf_conntrack_tuple *newreply);

/* Is this tuple taken? (ignoring any belonging to the given
@@ -218,7 +218,7 @@ static inline void nf_ct_refresh(struct nf_conn *ct,
/* Update TCP window tracking data when NAT mangles the packet */
extern void nf_conntrack_tcp_update(struct sk_buff *skb,
				    unsigned int dataoff,
				    struct nf_conn *conntrack,
				    struct nf_conn *ct,
				    int dir);

/* Fake conntrack entry for untracked connections */
+2 −2
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ struct nf_conntrack_l3proto
			   const struct nf_conntrack_tuple *);

	/* Returns verdict for packet, or -1 for invalid. */
	int (*packet)(struct nf_conn *conntrack,
	int (*packet)(struct nf_conn *ct,
		      const struct sk_buff *skb,
		      enum ip_conntrack_info ctinfo);

@@ -51,7 +51,7 @@ struct nf_conntrack_l3proto
	 * Called when a new connection for this protocol found;
	 * returns TRUE if it's OK.  If so, packet() called next.
	 */
	int (*new)(struct nf_conn *conntrack, const struct sk_buff *skb);
	int (*new)(struct nf_conn *ct, const struct sk_buff *skb);

	/*
	 * Called before tracking. 
+3 −3
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ struct nf_conntrack_l4proto
			    const struct nf_conntrack_tuple *orig);

	/* Returns verdict for packet, or -1 for invalid. */
	int (*packet)(struct nf_conn *conntrack,
	int (*packet)(struct nf_conn *ct,
		      const struct sk_buff *skb,
		      unsigned int dataoff,
		      enum ip_conntrack_info ctinfo,
@@ -45,11 +45,11 @@ struct nf_conntrack_l4proto

	/* Called when a new connection for this protocol found;
	 * returns TRUE if it's OK.  If so, packet() called next. */
	int (*new)(struct nf_conn *conntrack, const struct sk_buff *skb,
	int (*new)(struct nf_conn *ct, const struct sk_buff *skb,
		   unsigned int dataoff);

	/* Called when a conntrack entry is destroyed */
	void (*destroy)(struct nf_conn *conntrack);
	void (*destroy)(struct nf_conn *ct);

	int (*error)(struct sk_buff *skb, unsigned int dataoff,
		     enum ip_conntrack_info *ctinfo,
+6 −6
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ static int icmp_packet(struct nf_conn *ct,
}

/* Called when a new connection for this protocol found. */
static int icmp_new(struct nf_conn *conntrack,
static int icmp_new(struct nf_conn *ct,
		    const struct sk_buff *skb, unsigned int dataoff)
{
	static const u_int8_t valid_new[] = {
@@ -110,15 +110,15 @@ static int icmp_new(struct nf_conn *conntrack,
		[ICMP_ADDRESS] = 1
	};

	if (conntrack->tuplehash[0].tuple.dst.u.icmp.type >= sizeof(valid_new)
	    || !valid_new[conntrack->tuplehash[0].tuple.dst.u.icmp.type]) {
	if (ct->tuplehash[0].tuple.dst.u.icmp.type >= sizeof(valid_new)
	    || !valid_new[ct->tuplehash[0].tuple.dst.u.icmp.type]) {
		/* Can't create a new ICMP `conn' with this. */
		pr_debug("icmp: can't create new conn with type %u\n",
			 conntrack->tuplehash[0].tuple.dst.u.icmp.type);
		NF_CT_DUMP_TUPLE(&conntrack->tuplehash[0].tuple);
			 ct->tuplehash[0].tuple.dst.u.icmp.type);
		NF_CT_DUMP_TUPLE(&ct->tuplehash[0].tuple);
		return 0;
	}
	atomic_set(&conntrack->proto.icmp.count, 0);
	atomic_set(&ct->proto.icmp.count, 0);
	return 1;
}

+5 −5
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ static int
gre_unique_tuple(struct nf_conntrack_tuple *tuple,
		 const struct nf_nat_range *range,
		 enum nf_nat_manip_type maniptype,
		 const struct nf_conn *conntrack)
		 const struct nf_conn *ct)
{
	static u_int16_t key;
	__be16 *keyptr;
@@ -67,7 +67,7 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,

	/* If there is no master conntrack we are not PPTP,
	   do not change tuples */
	if (!conntrack->master)
	if (!ct->master)
		return 0;

	if (maniptype == IP_NAT_MANIP_SRC)
@@ -76,7 +76,7 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,
		keyptr = &tuple->dst.u.gre.key;

	if (!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED)) {
		pr_debug("%p: NATing GRE PPTP\n", conntrack);
		pr_debug("%p: NATing GRE PPTP\n", ct);
		min = 1;
		range_size = 0xffff;
	} else {
@@ -88,11 +88,11 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,

	for (i = 0; i < range_size; i++, key++) {
		*keyptr = htons(min + key % range_size);
		if (!nf_nat_used_tuple(tuple, conntrack))
		if (!nf_nat_used_tuple(tuple, ct))
			return 1;
	}

	pr_debug("%p: no NAT mapping\n", conntrack);
	pr_debug("%p: no NAT mapping\n", ct);
	return 0;
}

Loading