]> err.no Git - linux-2.6/blobdiff - net/ipv6/ipcomp6.c
[NETFILTER]: Check policy length in policy match strict mode
[linux-2.6] / net / ipv6 / ipcomp6.c
index 135383ef538f5a33573d745d17962237af3ae082..d511a884dad07504fb73aeb5bf134086aff3c152 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/rtnetlink.h>
 #include <net/icmp.h>
 #include <net/ipv6.h>
+#include <net/protocol.h>
 #include <linux/ipv6.h>
 #include <linux/icmpv6.h>
 
@@ -130,8 +131,7 @@ static int ipcomp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, s
 out_put_cpu:
        put_cpu();
 out:
-       if (tmp_hdr)
-               kfree(tmp_hdr);
+       kfree(tmp_hdr);
        if (err)
                goto error_out;
        return nexthdr;
@@ -212,8 +212,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        if (!x)
                return;
 
-       printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/"
-                       "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
+       printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/" NIP6_FMT "\n",
                        spi, NIP6(iph->daddr));
        xfrm_state_put(x);
 }
@@ -341,8 +340,7 @@ static void ipcomp6_free_tfms(struct crypto_tfm **tfms)
 
        for_each_cpu(cpu) {
                struct crypto_tfm *tfm = *per_cpu_ptr(tfms, cpu);
-               if (tfm)
-                       crypto_free_tfm(tfm);
+               crypto_free_tfm(tfm);
        }
        free_percpu(tfms);
 }