Merge tag 'xfs-4.20-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-2.6-block.git] / net / netfilter / nf_flow_table_core.c
index 185c633b6872b1cf9b04b76f09b14ca2b4a3c5ea..b7a4816add76530fe0831afbeaa417f3039e9a27 100644 (file)
@@ -465,14 +465,17 @@ EXPORT_SYMBOL_GPL(nf_flow_table_init);
 static void nf_flow_table_do_cleanup(struct flow_offload *flow, void *data)
 {
        struct net_device *dev = data;
+       struct flow_offload_entry *e;
+
+       e = container_of(flow, struct flow_offload_entry, flow);
 
        if (!dev) {
                flow_offload_teardown(flow);
                return;
        }
-
-       if (flow->tuplehash[0].tuple.iifidx == dev->ifindex ||
-           flow->tuplehash[1].tuple.iifidx == dev->ifindex)
+       if (net_eq(nf_ct_net(e->ct), dev_net(dev)) &&
+           (flow->tuplehash[0].tuple.iifidx == dev->ifindex ||
+            flow->tuplehash[1].tuple.iifidx == dev->ifindex))
                flow_offload_dead(flow);
 }
 
@@ -483,7 +486,7 @@ static void nf_flow_table_iterate_cleanup(struct nf_flowtable *flowtable,
        flush_delayed_work(&flowtable->gc_work);
 }
 
-void nf_flow_table_cleanup(struct net *net, struct net_device *dev)
+void nf_flow_table_cleanup(struct net_device *dev)
 {
        struct nf_flowtable *flowtable;