]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/nf_conntrack_sip.c
mm: share PG_readahead and PG_reclaim
[linux-2.6-omap-h63xx.git] / net / netfilter / nf_conntrack_sip.c
index 9dec115346784428f3b2a18a64873ce77299f2db..1276a442f10c53936d021be834631860285fd660 100644 (file)
 #include <net/netfilter/nf_conntrack_helper.h>
 #include <linux/netfilter/nf_conntrack_sip.h>
 
-#if 0
-#define DEBUGP printk
-#else
-#define DEBUGP(format, args...)
-#endif
-
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Christian Hentschel <chentschel@arnet.com.ar>");
 MODULE_DESCRIPTION("SIP connection tracking helper");
@@ -285,7 +279,7 @@ static int epaddr_len(struct nf_conn *ct, const char *dptr,
        const char *aux = dptr;
 
        if (!parse_addr(ct, dptr, &dptr, &addr, limit)) {
-               DEBUGP("ip: %s parse failed.!\n", dptr);
+               pr_debug("ip: %s parse failed.!\n", dptr);
                return 0;
        }
 
@@ -341,11 +335,11 @@ int ct_sip_get_info(struct nf_conn *ct,
                        continue;
                }
                aux = ct_sip_search(hnfo->ln_str, dptr, hnfo->ln_strlen,
-                                   ct_sip_lnlen(dptr, limit),
+                                   ct_sip_lnlen(dptr, limit),
                                    hnfo->case_sensitive);
                if (!aux) {
-                       DEBUGP("'%s' not found in '%s'.\n", hnfo->ln_str,
-                              hnfo->lname);
+                       pr_debug("'%s' not found in '%s'.\n", hnfo->ln_str,
+                                hnfo->lname);
                        return -1;
                }
                aux += hnfo->ln_strlen;
@@ -356,11 +350,11 @@ int ct_sip_get_info(struct nf_conn *ct,
 
                *matchoff = (aux - k) + shift;
 
-               DEBUGP("%s match succeeded! - len: %u\n", hnfo->lname,
-                      *matchlen);
+               pr_debug("%s match succeeded! - len: %u\n", hnfo->lname,
+                        *matchlen);
                return 1;
        }
-       DEBUGP("%s header not found.\n", hnfo->lname);
+       pr_debug("%s header not found.\n", hnfo->lname);
        return 0;
 }
 EXPORT_SYMBOL_GPL(ct_sip_get_info);
@@ -378,23 +372,23 @@ static int set_expected_rtp(struct sk_buff **pskb,
        int ret;
        typeof(nf_nat_sdp_hook) nf_nat_sdp;
 
-       exp = nf_conntrack_expect_alloc(ct);
+       exp = nf_ct_expect_alloc(ct);
        if (exp == NULL)
                return NF_DROP;
-       nf_conntrack_expect_init(exp, family,
-                                &ct->tuplehash[!dir].tuple.src.u3, addr,
-                                IPPROTO_UDP, NULL, &port);
+       nf_ct_expect_init(exp, family,
+                         &ct->tuplehash[!dir].tuple.src.u3, addr,
+                         IPPROTO_UDP, NULL, &port);
 
        nf_nat_sdp = rcu_dereference(nf_nat_sdp_hook);
        if (nf_nat_sdp && ct->status & IPS_NAT_MASK)
                ret = nf_nat_sdp(pskb, ctinfo, exp, dptr);
        else {
-               if (nf_conntrack_expect_related(exp) != 0)
+               if (nf_ct_expect_related(exp) != 0)
                        ret = NF_DROP;
                else
                        ret = NF_ACCEPT;
        }
-       nf_conntrack_expect_put(exp);
+       nf_ct_expect_put(exp);
 
        return ret;
 }
@@ -424,7 +418,7 @@ static int sip_help(struct sk_buff **pskb,
        if (!skb_is_nonlinear(*pskb))
                dptr = (*pskb)->data + dataoff;
        else {
-               DEBUGP("Copy of skbuff not supported yet.\n");
+               pr_debug("Copy of skbuff not supported yet.\n");
                goto out;
        }
 
@@ -442,6 +436,9 @@ static int sip_help(struct sk_buff **pskb,
 
        /* RTP info only in some SDP pkts */
        if (memcmp(dptr, "INVITE", sizeof("INVITE") - 1) != 0 &&
+           memcmp(dptr, "UPDATE", sizeof("UPDATE") - 1) != 0 &&
+           memcmp(dptr, "SIP/2.0 180", sizeof("SIP/2.0 180") - 1) != 0 &&
+           memcmp(dptr, "SIP/2.0 183", sizeof("SIP/2.0 183") - 1) != 0 &&
            memcmp(dptr, "SIP/2.0 200", sizeof("SIP/2.0 200") - 1) != 0) {
                goto out;
        }
@@ -451,12 +448,12 @@ static int sip_help(struct sk_buff **pskb,
 
                /* We'll drop only if there are parse problems. */
                if (!parse_addr(ct, dptr + matchoff, NULL, &addr,
-                               dptr + datalen)) {
+                               dptr + datalen)) {
                        ret = NF_DROP;
                        goto out;
                }
                if (ct_sip_get_info(ct, dptr, datalen, &matchoff, &matchlen,
-                                   POS_MEDIA) > 0) {
+                                   POS_MEDIA) > 0) {
 
                        port = simple_strtoul(dptr + matchoff, NULL, 10);
                        if (port < 1024) {
@@ -503,9 +500,6 @@ static int __init nf_conntrack_sip_init(void)
                for (j = 0; j < 2; j++) {
                        sip[i][j].tuple.dst.protonum = IPPROTO_UDP;
                        sip[i][j].tuple.src.u.udp.port = htons(ports[i]);
-                       sip[i][j].mask.src.l3num = 0xFFFF;
-                       sip[i][j].mask.src.u.udp.port = htons(0xFFFF);
-                       sip[i][j].mask.dst.protonum = 0xFF;
                        sip[i][j].max_expected = 2;
                        sip[i][j].timeout = 3 * 60; /* 3 minutes */
                        sip[i][j].me = THIS_MODULE;
@@ -518,7 +512,7 @@ static int __init nf_conntrack_sip_init(void)
                                sprintf(tmpname, "sip-%u", i);
                        sip[i][j].name = tmpname;
 
-                       DEBUGP("port #%u: %u\n", i, ports[i]);
+                       pr_debug("port #%u: %u\n", i, ports[i]);
 
                        ret = nf_conntrack_helper_register(&sip[i][j]);
                        if (ret) {