diff options
Diffstat (limited to 'net/ieee802154/dgram.c')
-rw-r--r-- | net/ieee802154/dgram.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index faecf648123f..1b09eaabaac1 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c | |||
@@ -209,6 +209,7 @@ static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
209 | unsigned mtu; | 209 | unsigned mtu; |
210 | struct sk_buff *skb; | 210 | struct sk_buff *skb; |
211 | struct dgram_sock *ro = dgram_sk(sk); | 211 | struct dgram_sock *ro = dgram_sk(sk); |
212 | int hlen, tlen; | ||
212 | int err; | 213 | int err; |
213 | 214 | ||
214 | if (msg->msg_flags & MSG_OOB) { | 215 | if (msg->msg_flags & MSG_OOB) { |
@@ -229,13 +230,15 @@ static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
229 | mtu = dev->mtu; | 230 | mtu = dev->mtu; |
230 | pr_debug("name = %s, mtu = %u\n", dev->name, mtu); | 231 | pr_debug("name = %s, mtu = %u\n", dev->name, mtu); |
231 | 232 | ||
232 | skb = sock_alloc_send_skb(sk, LL_ALLOCATED_SPACE(dev) + size, | 233 | hlen = LL_RESERVED_SPACE(dev); |
234 | tlen = dev->needed_tailroom; | ||
235 | skb = sock_alloc_send_skb(sk, hlen + tlen + size, | ||
233 | msg->msg_flags & MSG_DONTWAIT, | 236 | msg->msg_flags & MSG_DONTWAIT, |
234 | &err); | 237 | &err); |
235 | if (!skb) | 238 | if (!skb) |
236 | goto out_dev; | 239 | goto out_dev; |
237 | 240 | ||
238 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 241 | skb_reserve(skb, hlen); |
239 | 242 | ||
240 | skb_reset_network_header(skb); | 243 | skb_reset_network_header(skb); |
241 | 244 | ||