358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch 869 B

12345678910111213141516171819202122
  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. The offload ip hook expects a pointer to the flowtable, not to the
  5. rhashtable. Since the rhashtable is the first member, this is safe for
  6. the moment, but breaks as soon as the structure layout changes
  7. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  8. ---
  9. --- a/net/netfilter/nf_tables_api.c
  10. +++ b/net/netfilter/nf_tables_api.c
  11. @@ -4975,7 +4975,7 @@ static int nf_tables_flowtable_parse_hoo
  12. flowtable->ops[i].pf = NFPROTO_NETDEV;
  13. flowtable->ops[i].hooknum = hooknum;
  14. flowtable->ops[i].priority = priority;
  15. - flowtable->ops[i].priv = &flowtable->data.rhashtable;
  16. + flowtable->ops[i].priv = &flowtable->data;
  17. flowtable->ops[i].hook = flowtable->data.type->hook;
  18. flowtable->ops[i].dev = dev_array[i];
  19. }