aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp/l2tp_ppp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/l2tp/l2tp_ppp.c')
-rw-r--r--net/l2tp/l2tp_ppp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index f42cd0915966..8a90d756c904 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -395,6 +395,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
395 struct pppol2tp_session *ps; 395 struct pppol2tp_session *ps;
396 int old_headroom; 396 int old_headroom;
397 int new_headroom; 397 int new_headroom;
398 int uhlen, headroom;
398 399
399 if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) 400 if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED))
400 goto abort; 401 goto abort;
@@ -413,7 +414,13 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
413 goto abort_put_sess; 414 goto abort_put_sess;
414 415
415 old_headroom = skb_headroom(skb); 416 old_headroom = skb_headroom(skb);
416 if (skb_cow_head(skb, sizeof(ppph))) 417 uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0;
418 headroom = NET_SKB_PAD +
419 sizeof(struct iphdr) + /* IP header */
420 uhlen + /* UDP header (if L2TP_ENCAPTYPE_UDP) */
421 session->hdr_len + /* L2TP header */
422 sizeof(ppph); /* PPP header */
423 if (skb_cow_head(skb, headroom))
417 goto abort_put_sess_tun; 424 goto abort_put_sess_tun;
418 425
419 new_headroom = skb_headroom(skb); 426 new_headroom = skb_headroom(skb);