818498b1e7d7a9313eff7ed7aa2860bcb870963b
[openwrt/staging/robimarko.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Tue, 20 Feb 2018 14:48:51 +0100
3 Subject: [PATCH] netfilter: nf_flow_table: fix priv pointer for netdev hook
4
5 The offload ip hook expects a pointer to the flowtable, not to the
6 rhashtable. Since the rhashtable is the first member, this is safe for
7 the moment, but breaks as soon as the structure layout changes
8
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 ---
11
12 --- a/net/netfilter/nf_tables_api.c
13 +++ b/net/netfilter/nf_tables_api.c
14 @@ -4965,7 +4965,7 @@ static int nf_tables_flowtable_parse_hoo
15 flowtable->ops[i].pf = NFPROTO_NETDEV;
16 flowtable->ops[i].hooknum = hooknum;
17 flowtable->ops[i].priority = priority;
18 - flowtable->ops[i].priv = &flowtable->data.rhashtable;
19 + flowtable->ops[i].priv = &flowtable->data;
20 flowtable->ops[i].hook = flowtable->data.type->hook;
21 flowtable->ops[i].dev = dev_array[i];
22 }