Commit a34c4589 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds
Browse files

netfilter endian regressions



no real bugs, just misannotations cropping up

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e0e5de00
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@ struct xt_connlimit_data;

struct xt_connlimit_info {
	union {
		u_int32_t v4_mask;
		u_int32_t v6_mask[4];
		__be32 v4_mask;
		__be32 v6_mask[4];
	};
	unsigned int limit, inverse;

+2 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ union nf_conntrack_address {
union nf_conntrack_man_proto
{
	/* Add other protocols here. */
	u_int16_t all;
	__be16 all;

	struct {
		__be16 port;
@@ -73,7 +73,7 @@ struct nf_conntrack_tuple
		union nf_conntrack_address u3;
		union {
			/* Add other protocols here. */
			u_int16_t all;
			__be16 all;

			struct {
				__be16 port;
+2 −1
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@ static inline unsigned int
hash_by_src(const struct nf_conntrack_tuple *tuple)
{
	/* Original src, to ensure we map it consistently if poss. */
	return jhash_3words((__force u32)tuple->src.u3.ip, tuple->src.u.all,
	return jhash_3words((__force u32)tuple->src.u3.ip,
			    (__force u32)tuple->src.u.all,
			    tuple->dst.protonum, 0) % nf_nat_htable_size;
}

+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ alloc_null_binding_confirmed(struct nf_conn *ct, unsigned int hooknum)
		= (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC
		   ? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip
		   : ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip);
	u_int16_t all
	__be16 all
		= (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC
		   ? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.all
		   : ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u.all);
+2 −1
Original line number Diff line number Diff line
@@ -79,7 +79,8 @@ static u_int32_t __hash_conntrack(const struct nf_conntrack_tuple *tuple,
	a = jhash2(tuple->src.u3.all, ARRAY_SIZE(tuple->src.u3.all),
		   (tuple->src.l3num << 16) | tuple->dst.protonum);
	b = jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all),
		   (tuple->src.u.all << 16) | tuple->dst.u.all);
		   ((__force __u16)tuple->src.u.all << 16) |
		    (__force __u16)tuple->dst.u.all);

	return jhash_2words(a, b, rnd) % size;
}
Loading