diff options
author | Alex Shi <alex.shi@linaro.org> | 2018-02-01 12:02:34 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2018-02-01 12:02:34 +0800 |
commit | a40f2a595adfe0be6ced06fdb4c4a24ae3291a91 (patch) | |
tree | 4e99ec8bd3ce134bdbafd54a0fc873f11c33e21b /drivers/net/ppp/pppoe.c | |
parent | 293c379504006b5ea8b4e7109ba4ebc3211f9b91 (diff) | |
parent | 49fe90b853dfb1087d0a734cd7f4af1aa00c8e53 (diff) |
Merge tag 'v4.4.114' into linux-linaro-lsk-v4.4lsk-v4.4-18.02
This is the 4.4.114 stable release
Diffstat (limited to 'drivers/net/ppp/pppoe.c')
-rw-r--r-- | drivers/net/ppp/pppoe.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index 4e0068e775f9..b7b859c3a0c7 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c @@ -860,6 +860,7 @@ static int pppoe_sendmsg(struct socket *sock, struct msghdr *m, struct pppoe_hdr *ph; struct net_device *dev; char *start; + int hlen; lock_sock(sk); if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) { @@ -878,16 +879,16 @@ static int pppoe_sendmsg(struct socket *sock, struct msghdr *m, if (total_len > (dev->mtu + dev->hard_header_len)) goto end; - - skb = sock_wmalloc(sk, total_len + dev->hard_header_len + 32, - 0, GFP_KERNEL); + hlen = LL_RESERVED_SPACE(dev); + skb = sock_wmalloc(sk, hlen + sizeof(*ph) + total_len + + dev->needed_tailroom, 0, GFP_KERNEL); if (!skb) { error = -ENOMEM; goto end; } /* Reserve space for headers. */ - skb_reserve(skb, dev->hard_header_len); + skb_reserve(skb, hlen); skb_reset_network_header(skb); skb->dev = dev; @@ -948,7 +949,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) /* Copy the data if there is no space for the header or if it's * read-only. */ - if (skb_cow_head(skb, sizeof(*ph) + dev->hard_header_len)) + if (skb_cow_head(skb, LL_RESERVED_SPACE(dev) + sizeof(*ph))) goto abort; __skb_push(skb, sizeof(*ph)); |