]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/nf_conntrack_amanda.c
Merge branch 'devel' into for-linus
[linux-2.6-omap-h63xx.git] / net / netfilter / nf_conntrack_amanda.c
index 7b8239c0cd5eed58036362de1ea5caa2de085fa7..07d9d8857e5db50b2d80bca709e137c4472b8724 100644 (file)
@@ -30,6 +30,7 @@ MODULE_AUTHOR("Brian J. Murrell <netfilter@interlinx.bc.ca>");
 MODULE_DESCRIPTION("Amanda connection tracking module");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ip_conntrack_amanda");
+MODULE_ALIAS_NFCT_HELPER("amanda");
 
 module_param(master_timeout, uint, 0600);
 MODULE_PARM_DESC(master_timeout, "timeout for the master connection");
@@ -53,7 +54,7 @@ enum amanda_strings {
 };
 
 static struct {
-       char                    *string;
+       const char              *string;
        size_t                  len;
        struct ts_config        *ts;
 } search[] __read_mostly = {
@@ -91,7 +92,6 @@ static int amanda_help(struct sk_buff *skb,
        char pbuf[sizeof("65535")], *tmp;
        u_int16_t len;
        __be16 port;
-       int family = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.l3num;
        int ret = NF_ACCEPT;
        typeof(nf_nat_amanda_hook) nf_nat_amanda;
 
@@ -148,7 +148,9 @@ static int amanda_help(struct sk_buff *skb,
                        goto out;
                }
                tuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple;
-               nf_ct_expect_init(exp, family, &tuple->src.u3, &tuple->dst.u3,
+               nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT,
+                                 nf_ct_l3num(ct),
+                                 &tuple->src.u3, &tuple->dst.u3,
                                  IPPROTO_TCP, NULL, &port);
 
                nf_nat_amanda = rcu_dereference(nf_nat_amanda_hook);
@@ -164,26 +166,29 @@ out:
        return ret;
 }
 
+static const struct nf_conntrack_expect_policy amanda_exp_policy = {
+       .max_expected           = 3,
+       .timeout                = 180,
+};
+
 static struct nf_conntrack_helper amanda_helper[2] __read_mostly = {
        {
                .name                   = "amanda",
-               .max_expected           = 3,
-               .timeout                = 180,
                .me                     = THIS_MODULE,
                .help                   = amanda_help,
                .tuple.src.l3num        = AF_INET,
-               .tuple.src.u.udp.port   = __constant_htons(10080),
+               .tuple.src.u.udp.port   = cpu_to_be16(10080),
                .tuple.dst.protonum     = IPPROTO_UDP,
+               .expect_policy          = &amanda_exp_policy,
        },
        {
                .name                   = "amanda",
-               .max_expected           = 3,
-               .timeout                = 180,
                .me                     = THIS_MODULE,
                .help                   = amanda_help,
                .tuple.src.l3num        = AF_INET6,
-               .tuple.src.u.udp.port   = __constant_htons(10080),
+               .tuple.src.u.udp.port   = cpu_to_be16(10080),
                .tuple.dst.protonum     = IPPROTO_UDP,
+               .expect_policy          = &amanda_exp_policy,
        },
 };