diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 44ff7f356ec15f25b8e61b81b0363f48f8d0e26e..9594dbc32165fffc6fbfd15f6df72ce8b546ee5c 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -42,6 +42,8 @@ static DEFINE_MUTEX(zones_mutex); struct zones_ht_key { struct net *net; u16 zone; + /* Note : pad[] must be the last field. */ + u8 pad[]; }; struct tcf_ct_flow_table { @@ -58,7 +60,7 @@ struct tcf_ct_flow_table { static const struct rhashtable_params zones_params = { .head_offset = offsetof(struct tcf_ct_flow_table, node), .key_offset = offsetof(struct tcf_ct_flow_table, key), - .key_len = sizeof_field(struct tcf_ct_flow_table, key), + .key_len = offsetof(struct zones_ht_key, pad), .automatic_shrinking = true, };