git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netpoll: fix netpoll_send_udp() bugs
[pandora-kernel.git]
/
net
/
core
/
netpoll.c
diff --git
a/net/core/netpoll.c
b/net/core/netpoll.c
index
ab0633f
..
db4bb7a
100644
(file)
--- a/
net/core/netpoll.c
+++ b/
net/core/netpoll.c
@@
-351,22
+351,23
@@
EXPORT_SYMBOL(netpoll_send_skb_on_dev);
void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
{
void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
{
- int total_len,
eth_len,
ip_len, udp_len;
+ int total_len, ip_len, udp_len;
struct sk_buff *skb;
struct udphdr *udph;
struct iphdr *iph;
struct ethhdr *eth;
udp_len = len + sizeof(*udph);
struct sk_buff *skb;
struct udphdr *udph;
struct iphdr *iph;
struct ethhdr *eth;
udp_len = len + sizeof(*udph);
- ip_len =
eth_len =
udp_len + sizeof(*iph);
- total_len =
eth_len + ETH_HLEN + NET_IP_ALIGN
;
+ ip_len = udp_len + sizeof(*iph);
+ total_len =
ip_len + LL_RESERVED_SPACE(np->dev)
;
- skb = find_skb(np, total_len, total_len - len);
+ skb = find_skb(np, total_len + np->dev->needed_tailroom,
+ total_len - len);
if (!skb)
return;
skb_copy_to_linear_data(skb, msg, len);
if (!skb)
return;
skb_copy_to_linear_data(skb, msg, len);
- skb
->len += len
;
+ skb
_put(skb, len)
;
skb_push(skb, sizeof(*udph));
skb_reset_transport_header(skb);
skb_push(skb, sizeof(*udph));
skb_reset_transport_header(skb);