]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/esp6.c
hwmon: (ams) Convert to a new-style i2c driver
[linux-2.6-omap-h63xx.git] / net / ipv6 / esp6.c
index 0ec1402320ea63898bd9761b6bb243cab14dad12..b181b08fb761c4f9cab3e4f06dfc439734213298 100644 (file)
@@ -282,7 +282,7 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
        struct scatterlist *sg;
        struct scatterlist *asg;
 
-       if (!pskb_may_pull(skb, sizeof(*esph))) {
+       if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead))) {
                ret = -EINVAL;
                goto out;
        }
@@ -521,6 +521,10 @@ static int esp6_init_state(struct xfrm_state *x)
                              crypto_aead_ivsize(aead);
        switch (x->props.mode) {
        case XFRM_MODE_BEET:
+               if (x->sel.family != AF_INET6)
+                       x->props.header_len += IPV4_BEET_PHMAXLEN +
+                                              (sizeof(struct ipv6hdr) - sizeof(struct iphdr));
+               break;
        case XFRM_MODE_TRANSPORT:
                break;
        case XFRM_MODE_TUNNEL: