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)
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);
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,
};
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,
};
return NULL;
}
- newoff = ALIGN(oldlen, t->align);
+ newoff = ALIGN(oldlen, __alignof__(struct nf_ct_ext));
newlen = newoff + t->len;
rcu_read_unlock();
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,
};
static const struct nf_ct_ext_type labels_extend = {
.len = sizeof(struct nf_conn_labels),
- .align = __alignof__(struct nf_conn_labels),
.id = NF_CT_EXT_LABELS,
};
static const struct nf_ct_ext_type nf_ct_seqadj_extend = {
.len = sizeof(struct nf_conn_seqadj),
- .align = __alignof__(struct nf_conn_seqadj),
.id = NF_CT_EXT_SEQADJ,
};
static const struct nf_ct_ext_type timeout_extend = {
.len = sizeof(struct nf_conn_timeout),
- .align = __alignof__(struct nf_conn_timeout),
.id = NF_CT_EXT_TIMEOUT,
};
static const struct nf_ct_ext_type tstamp_extend = {
.len = sizeof(struct nf_conn_tstamp),
- .align = __alignof__(struct nf_conn_tstamp),
.id = NF_CT_EXT_TSTAMP,
};
static struct nf_ct_ext_type nat_extend __read_mostly = {
.len = sizeof(struct nf_conn_nat),
- .align = __alignof__(struct nf_conn_nat),
.destroy = nf_nat_cleanup_conntrack,
.id = NF_CT_EXT_NAT,
};
static struct nf_ct_ext_type nf_ct_synproxy_extend __read_mostly = {
.len = sizeof(struct nf_conn_synproxy),
- .align = __alignof__(struct nf_conn_synproxy),
.id = NF_CT_EXT_SYNPROXY,
};
static struct nf_ct_ext_type act_ct_extend __read_mostly = {
.len = sizeof(struct nf_conn_act_ct_ext),
- .align = __alignof__(struct nf_conn_act_ct_ext),
.id = NF_CT_EXT_ACT_CT,
};