]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/netfilter/nf_conntrack_sip.c
netfilter: nf_ct_sip: handle non-linear skbs
[net-next-2.6.git] / net / netfilter / nf_conntrack_sip.c
index 8dd75d90efc0821932e94d7824267237e06bfdab..53d892210a049363fa3ab04f6e17b04fa9969bbe 100644 (file)
@@ -284,7 +284,7 @@ EXPORT_SYMBOL_GPL(ct_sip_parse_request);
  * tabs, spaces and continuation lines, which are treated as a single whitespace
  * character.
  *
- * Some headers may appear multiple times. A comma seperated list of values is
+ * Some headers may appear multiple times. A comma separated list of values is
  * equivalent to multiple headers.
  */
 static const struct sip_header ct_sip_hdrs[] = {
@@ -421,7 +421,7 @@ int ct_sip_get_header(const struct nf_conn *ct, const char *dptr,
 }
 EXPORT_SYMBOL_GPL(ct_sip_get_header);
 
-/* Get next header field in a list of comma seperated values */
+/* Get next header field in a list of comma separated values */
 static int ct_sip_next_header(const struct nf_conn *ct, const char *dptr,
                              unsigned int dataoff, unsigned int datalen,
                              enum sip_header_types type,
@@ -1393,10 +1393,8 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
 
        nf_ct_refresh(ct, skb, sip_timeout * HZ);
 
-       if (skb_is_nonlinear(skb)) {
-               pr_debug("Copy of skbuff not supported yet.\n");
-               return NF_ACCEPT;
-       }
+       if (unlikely(skb_linearize(skb)))
+               return NF_DROP;
 
        dptr = skb->data + dataoff;
        datalen = skb->len - dataoff;
@@ -1455,10 +1453,8 @@ static int sip_help_udp(struct sk_buff *skb, unsigned int protoff,
 
        nf_ct_refresh(ct, skb, sip_timeout * HZ);
 
-       if (skb_is_nonlinear(skb)) {
-               pr_debug("Copy of skbuff not supported yet.\n");
-               return NF_ACCEPT;
-       }
+       if (unlikely(skb_linearize(skb)))
+               return NF_DROP;
 
        dptr = skb->data + dataoff;
        datalen = skb->len - dataoff;
@@ -1549,8 +1545,8 @@ static int __init nf_conntrack_sip_init(void)
 
                        ret = nf_conntrack_helper_register(&sip[i][j]);
                        if (ret) {
-                               printk("nf_ct_sip: failed to register helper "
-                                      "for pf: %u port: %u\n",
+                               printk(KERN_ERR "nf_ct_sip: failed to register"
+                                      " helper for pf: %u port: %u\n",
                                       sip[i][j].tuple.src.l3num, ports[i]);
                                nf_conntrack_sip_fini();
                                return ret;