Merge branch 'linux-4.4' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into...
[firefly-linux-kernel-4.4.55.git] / net / netfilter / nf_synproxy_core.c
index d7f1685279034b5e3b62748284d24c52cc1f8907..c8a4a48bced988a29cd19df06a00117ea026c6ad 100644 (file)
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter/xt_tcpudp.h>
 #include <linux/netfilter/xt_SYNPROXY.h>
+
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_extend.h>
 #include <net/netfilter/nf_conntrack_seqadj.h>
 #include <net/netfilter/nf_conntrack_synproxy.h>
+#include <net/netfilter/nf_conntrack_zones.h>
 
 int synproxy_net_id;
 EXPORT_SYMBOL_GPL(synproxy_net_id);
@@ -186,7 +188,7 @@ unsigned int synproxy_tstamp_adjust(struct sk_buff *skb,
                                    const struct nf_conn_synproxy *synproxy)
 {
        unsigned int optoff, optend;
-       u32 *ptr, old;
+       __be32 *ptr, old;
 
        if (synproxy->tsoff == 0)
                return 1;
@@ -214,18 +216,18 @@ unsigned int synproxy_tstamp_adjust(struct sk_buff *skb,
                        if (op[0] == TCPOPT_TIMESTAMP &&
                            op[1] == TCPOLEN_TIMESTAMP) {
                                if (CTINFO2DIR(ctinfo) == IP_CT_DIR_REPLY) {
-                                       ptr = (u32 *)&op[2];
+                                       ptr = (__be32 *)&op[2];
                                        old = *ptr;
                                        *ptr = htonl(ntohl(*ptr) -
                                                     synproxy->tsoff);
                                } else {
-                                       ptr = (u32 *)&op[6];
+                                       ptr = (__be32 *)&op[6];
                                        old = *ptr;
                                        *ptr = htonl(ntohl(*ptr) +
                                                     synproxy->tsoff);
                                }
                                inet_proto_csum_replace4(&th->check, skb,
-                                                        old, *ptr, 0);
+                                                        old, *ptr, false);
                                return 1;
                        }
                        optoff += op[1];
@@ -352,7 +354,7 @@ static int __net_init synproxy_net_init(struct net *net)
        struct nf_conn *ct;
        int err = -ENOMEM;
 
-       ct = nf_ct_tmpl_alloc(net, 0, GFP_KERNEL);
+       ct = nf_ct_tmpl_alloc(net, &nf_ct_zone_dflt, GFP_KERNEL);
        if (!ct)
                goto err1;
 
@@ -378,7 +380,7 @@ static int __net_init synproxy_net_init(struct net *net)
 err3:
        free_percpu(snet->stats);
 err2:
-       nf_conntrack_free(ct);
+       nf_ct_tmpl_free(ct);
 err1:
        return err;
 }