ARM: config: sort select statements alphanumerically
[firefly-linux-kernel-4.4.55.git] / net / netfilter / nf_nat_core.c
index 29d4452351990d20f763d51c269734094a313d47..5f2f9109f4615e3dc1fa510c5136d10bfa20fba8 100644 (file)
@@ -201,10 +201,8 @@ find_appropriate_src(struct net *net, u16 zone,
                                       &ct->tuplehash[IP_CT_DIR_REPLY].tuple);
                        result->dst = tuple->dst;
 
-                       if (in_range(l3proto, l4proto, result, range)) {
-                               rcu_read_unlock();
+                       if (in_range(l3proto, l4proto, result, range))
                                return 1;
-                       }
                }
        }
        return 0;
@@ -255,7 +253,7 @@ find_best_ips_proto(u16 zone, struct nf_conntrack_tuple *tuple,
         * client coming from the same IP (some Internet Banking sites
         * like this), even across reboots.
         */
-       j = jhash2((u32 *)&tuple->src.u3, sizeof(tuple->src.u3),
+       j = jhash2((u32 *)&tuple->src.u3, sizeof(tuple->src.u3) / sizeof(u32),
                   range->flags & NF_NAT_RANGE_PERSISTENT ?
                        0 : (__force u32)tuple->dst.u3.all[max] ^ zone);
 
@@ -481,6 +479,8 @@ static int nf_nat_proto_clean(struct nf_conn *i, void *data)
 
        if (!nat)
                return 0;
+       if (!(i->status & IPS_SRC_NAT_DONE))
+               return 0;
        if ((clean->l3proto && nf_ct_l3num(i) != clean->l3proto) ||
            (clean->l4proto && nf_ct_protonum(i) != clean->l4proto))
                return 0;