Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97082
b: refs/heads/master
c: 090c48d
h: refs/heads/master
v: v3
  • Loading branch information
James Chapman authored and David S. Miller committed May 19, 2008
1 parent 7b1904f commit 658722a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 066b2118976e6e7cc50eed39e2747c75343a23c4
refs/heads/master: 090c48d3dd5ea90b37350334aaed9a93b0c1e0a1
13 changes: 8 additions & 5 deletions trunk/drivers/net/pppol2tp.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
__wsum csum = 0;
struct udphdr *uh;
unsigned int len;
int old_headroom;
int new_headroom;

if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED))
goto abort;
Expand All @@ -1001,16 +1003,18 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)

/* Check that there's enough headroom in the skb to insert IP,
* UDP and L2TP and PPP headers. If not enough, expand it to
* make room. Note that a new skb (or a clone) is
* allocated. If we return an error from this point on, make
* sure we free the new skb but do not free the original skb
* since that is done by the caller for the error case.
* make room. Adjust truesize.
*/
headroom = NET_SKB_PAD + sizeof(struct iphdr) +
sizeof(struct udphdr) + hdr_len + sizeof(ppph);
old_headroom = skb_headroom(skb);
if (skb_cow_head(skb, headroom))
goto abort;

new_headroom = skb_headroom(skb);
skb_orphan(skb);
skb->truesize += new_headroom - old_headroom;

/* Setup PPP header */
__skb_push(skb, sizeof(ppph));
skb->data[0] = ppph[0];
Expand Down Expand Up @@ -1065,7 +1069,6 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
/* Get routing info from the tunnel socket */
dst_release(skb->dst);
skb->dst = dst_clone(__sk_dst_get(sk_tun));
skb_orphan(skb);
skb->sk = sk_tun;

/* Queue the packet to IP for output */
Expand Down

0 comments on commit 658722a

Please sign in to comment.