aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/esp4.c3
-rw-r--r--net/ipv4/xfrm4_mode_beet.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index a315d5d22764..47c95e8ef045 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -294,7 +294,6 @@ static u32 esp4_get_mtu(struct xfrm_state *x, int mtu)
294 break; 294 break;
295 case XFRM_MODE_BEET: 295 case XFRM_MODE_BEET:
296 /* The worst case. */ 296 /* The worst case. */
297 mtu -= IPV4_BEET_PHMAXLEN;
298 mtu += min_t(u32, IPV4_BEET_PHMAXLEN, rem); 297 mtu += min_t(u32, IPV4_BEET_PHMAXLEN, rem);
299 break; 298 break;
300 } 299 }
@@ -409,6 +408,8 @@ static int esp_init_state(struct xfrm_state *x)
409 x->props.header_len = sizeof(struct ip_esp_hdr) + esp->conf.ivlen; 408 x->props.header_len = sizeof(struct ip_esp_hdr) + esp->conf.ivlen;
410 if (x->props.mode == XFRM_MODE_TUNNEL) 409 if (x->props.mode == XFRM_MODE_TUNNEL)
411 x->props.header_len += sizeof(struct iphdr); 410 x->props.header_len += sizeof(struct iphdr);
411 else if (x->props.mode == XFRM_MODE_BEET)
412 x->props.header_len += IPV4_BEET_PHMAXLEN;
412 if (x->encap) { 413 if (x->encap) {
413 struct xfrm_encap_tmpl *encap = x->encap; 414 struct xfrm_encap_tmpl *encap = x->encap;
414 415
diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c
index 0f7c3e30e4e6..a73e710740c2 100644
--- a/net/ipv4/xfrm4_mode_beet.c
+++ b/net/ipv4/xfrm4_mode_beet.c
@@ -40,7 +40,7 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
40 if (unlikely(optlen)) 40 if (unlikely(optlen))
41 hdrlen += IPV4_BEET_PHMAXLEN - (optlen & 4); 41 hdrlen += IPV4_BEET_PHMAXLEN - (optlen & 4);
42 42
43 skb_push(skb, x->props.header_len + hdrlen); 43 skb_push(skb, x->props.header_len - IPV4_BEET_PHMAXLEN + hdrlen);
44 skb_reset_network_header(skb); 44 skb_reset_network_header(skb);
45 top_iph = ip_hdr(skb); 45 top_iph = ip_hdr(skb);
46 skb->transport_header += sizeof(*iph) - hdrlen; 46 skb->transport_header += sizeof(*iph) - hdrlen;