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
cf64c1f
..
db4bb7a
100644
(file)
--- a/
net/core/netpoll.c
+++ b/
net/core/netpoll.c
@@
-194,7
+194,7
@@
static void netpoll_poll_dev(struct net_device *dev)
poll_napi(dev);
poll_napi(dev);
- if (dev->
priv_
flags & IFF_SLAVE) {
+ if (dev->flags & IFF_SLAVE) {
if (dev->npinfo) {
struct net_device *bond_dev = dev->master;
struct sk_buff *skb;
if (dev->npinfo) {
struct net_device *bond_dev = dev->master;
struct sk_buff *skb;
@@
-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);
@@
-763,7
+764,7
@@
int __netpoll_setup(struct netpoll *np)
}
/* last thing to do is link it to the net device structure */
}
/* last thing to do is link it to the net device structure */
-
RCU_INIT_POINTER
(ndev->npinfo, npinfo);
+
rcu_assign_pointer
(ndev->npinfo, npinfo);
return 0;
return 0;