]> err.no Git - linux-2.6/blobdiff - net/ipv6/xfrm6_tunnel.c
Merge branch 'locks' of git://linux-nfs.org/~bfields/linux
[linux-2.6] / net / ipv6 / xfrm6_tunnel.c
index 538499a8997506a2336ab10d0c7d457bcea5ae6c..3f8a3abde67ea47c2c5a9cef9a4137d751477a4a 100644 (file)
@@ -84,7 +84,7 @@ static int xfrm6_tunnel_spi_init(void)
        xfrm6_tunnel_spi_kmem = kmem_cache_create("xfrm6_tunnel_spi",
                                                  sizeof(struct xfrm6_tunnel_spi),
                                                  0, SLAB_HWCACHE_ALIGN,
-                                                 NULL, NULL);
+                                                 NULL);
        if (!xfrm6_tunnel_spi_kmem)
                return -ENOMEM;
 
@@ -242,11 +242,7 @@ EXPORT_SYMBOL(xfrm6_tunnel_free_spi);
 
 static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
 {
-       struct ipv6hdr *top_iph;
-
-       top_iph = (struct ipv6hdr *)skb->data;
-       top_iph->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
-
+       skb_push(skb, -skb_network_offset(skb));
        return 0;
 }
 
@@ -261,7 +257,7 @@ static int xfrm6_tunnel_rcv(struct sk_buff *skb)
        __be32 spi;
 
        spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&iph->saddr);
-       return xfrm6_rcv_spi(skb, spi);
+       return xfrm6_rcv_spi(skb, spi) > 0 ? : 0;
 }
 
 static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
@@ -379,3 +375,4 @@ static void __exit xfrm6_tunnel_fini(void)
 module_init(xfrm6_tunnel_init);
 module_exit(xfrm6_tunnel_fini);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_XFRM_TYPE(AF_INET6, XFRM_PROTO_IPV6);