ipv6: xfrm: Handle errors reported by xfrm6_find_1stfragopt()
[pandora-kernel.git] / net / ipv6 / xfrm6_mode_ro.c
index 957ae36..bc75be1 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
+#include <linux/spinlock.h>
 #include <linux/stringify.h>
 #include <linux/time.h>
 #include <net/ipv6.h>
@@ -47,6 +48,8 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb)
        iph = ipv6_hdr(skb);
 
        hdr_len = x->type->hdr_offset(x, skb, &prevhdr);
+       if (hdr_len < 0)
+               return hdr_len;
        skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data);
        skb_set_network_header(skb, -x->props.header_len);
        skb->transport_header = skb->network_header + hdr_len;
@@ -58,16 +61,7 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb)
        return 0;
 }
 
-/*
- * Do nothing about routing optimization header unlike IPsec.
- */
-static int xfrm6_ro_input(struct xfrm_state *x, struct sk_buff *skb)
-{
-       return 0;
-}
-
 static struct xfrm_mode xfrm6_ro_mode = {
-       .input = xfrm6_ro_input,
        .output = xfrm6_ro_output,
        .owner = THIS_MODULE,
        .encap = XFRM_MODE_ROUTEOPTIMIZATION,