Commit bb62a765 authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso
Browse files

netfilter: conntrack: make all extensions 8-byte alignned



All extensions except one need 8 byte alignment, so just make that the
default.

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 8b541364
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ enum nf_ct_ext_id {
struct nf_ct_ext {
	u8 offset[NF_CT_EXT_NUM];
	u8 len;
	char data[];
	char data[] __aligned(8);
};

static inline bool __nf_ct_ext_exist(const struct nf_ct_ext *ext, u8 id)
@@ -83,10 +83,7 @@ struct nf_ct_ext_type {
	void (*destroy)(struct nf_conn *ct);

	enum nf_ct_ext_id id;

	/* Length and min alignment. */
	u8 len;
	u8 align;
};

int nf_ct_extend_register(const struct nf_ct_ext_type *type);
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ MODULE_PARM_DESC(acct, "Enable connection tracking flow accounting.");

static const struct nf_ct_ext_type acct_extend = {
	.len	= sizeof(struct nf_conn_acct),
	.align	= __alignof__(struct nf_conn_acct),
	.id	= NF_CT_EXT_ACCT,
};

+0 −1
Original line number Diff line number Diff line
@@ -306,7 +306,6 @@ static int nf_ct_events __read_mostly = NF_CT_EVENTS_DEFAULT;

static const struct nf_ct_ext_type event_extend = {
	.len	= sizeof(struct nf_conntrack_ecache),
	.align	= __alignof__(struct nf_conntrack_ecache),
	.id	= NF_CT_EXT_ECACHE,
};

+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ void *nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
		return NULL;
	}

	newoff = ALIGN(oldlen, t->align);
	newoff = ALIGN(oldlen, __alignof__(struct nf_ct_ext));
	newlen = newoff + t->len;
	rcu_read_unlock();

+0 −1
Original line number Diff line number Diff line
@@ -552,7 +552,6 @@ EXPORT_SYMBOL_GPL(nf_nat_helper_unregister);

static const struct nf_ct_ext_type helper_extend = {
	.len	= sizeof(struct nf_conn_help),
	.align	= __alignof__(struct nf_conn_help),
	.id	= NF_CT_EXT_HELPER,
};

Loading