diff options
-rw-r--r-- | net/core/netpoll.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 3d84fb9d8873..f9f40b932e4b 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -362,22 +362,23 @@ EXPORT_SYMBOL(netpoll_send_skb_on_dev); | |||
362 | 362 | ||
363 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | 363 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len) |
364 | { | 364 | { |
365 | int total_len, eth_len, ip_len, udp_len; | 365 | int total_len, ip_len, udp_len; |
366 | struct sk_buff *skb; | 366 | struct sk_buff *skb; |
367 | struct udphdr *udph; | 367 | struct udphdr *udph; |
368 | struct iphdr *iph; | 368 | struct iphdr *iph; |
369 | struct ethhdr *eth; | 369 | struct ethhdr *eth; |
370 | 370 | ||
371 | udp_len = len + sizeof(*udph); | 371 | udp_len = len + sizeof(*udph); |
372 | ip_len = eth_len = udp_len + sizeof(*iph); | 372 | ip_len = udp_len + sizeof(*iph); |
373 | total_len = eth_len + ETH_HLEN + NET_IP_ALIGN; | 373 | total_len = ip_len + LL_RESERVED_SPACE(np->dev); |
374 | 374 | ||
375 | skb = find_skb(np, total_len, total_len - len); | 375 | skb = find_skb(np, total_len + np->dev->needed_tailroom, |
376 | total_len - len); | ||
376 | if (!skb) | 377 | if (!skb) |
377 | return; | 378 | return; |
378 | 379 | ||
379 | skb_copy_to_linear_data(skb, msg, len); | 380 | skb_copy_to_linear_data(skb, msg, len); |
380 | skb->len += len; | 381 | skb_put(skb, len); |
381 | 382 | ||
382 | skb_push(skb, sizeof(*udph)); | 383 | skb_push(skb, sizeof(*udph)); |
383 | skb_reset_transport_header(skb); | 384 | skb_reset_transport_header(skb); |