diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/hamradio/bpqether.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/hamradio/bpqether.c')
-rw-r--r-- | drivers/net/hamradio/bpqether.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index fe893c91a01b..14f01d156db9 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <linux/kernel.h> | 61 | #include <linux/kernel.h> |
62 | #include <linux/string.h> | 62 | #include <linux/string.h> |
63 | #include <linux/net.h> | 63 | #include <linux/net.h> |
64 | #include <linux/slab.h> | ||
64 | #include <net/ax25.h> | 65 | #include <net/ax25.h> |
65 | #include <linux/inet.h> | 66 | #include <linux/inet.h> |
66 | #include <linux/netdevice.h> | 67 | #include <linux/netdevice.h> |
@@ -167,10 +168,7 @@ static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev) | |||
167 | 168 | ||
168 | static inline int dev_is_ethdev(struct net_device *dev) | 169 | static inline int dev_is_ethdev(struct net_device *dev) |
169 | { | 170 | { |
170 | return ( | 171 | return (dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5)); |
171 | dev->type == ARPHRD_ETHER | ||
172 | && strncmp(dev->name, "dummy", 5) | ||
173 | ); | ||
174 | } | 172 | } |
175 | 173 | ||
176 | /* ------------------------------------------------------------------------ */ | 174 | /* ------------------------------------------------------------------------ */ |
@@ -186,7 +184,7 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty | |||
186 | struct ethhdr *eth; | 184 | struct ethhdr *eth; |
187 | struct bpqdev *bpq; | 185 | struct bpqdev *bpq; |
188 | 186 | ||
189 | if (dev_net(dev) != &init_net) | 187 | if (!net_eq(dev_net(dev), &init_net)) |
190 | goto drop; | 188 | goto drop; |
191 | 189 | ||
192 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) | 190 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) |
@@ -251,6 +249,7 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
251 | { | 249 | { |
252 | unsigned char *ptr; | 250 | unsigned char *ptr; |
253 | struct bpqdev *bpq; | 251 | struct bpqdev *bpq; |
252 | struct net_device *orig_dev; | ||
254 | int size; | 253 | int size; |
255 | 254 | ||
256 | /* | 255 | /* |
@@ -285,8 +284,9 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
285 | 284 | ||
286 | bpq = netdev_priv(dev); | 285 | bpq = netdev_priv(dev); |
287 | 286 | ||
287 | orig_dev = dev; | ||
288 | if ((dev = bpq_get_ether_dev(dev)) == NULL) { | 288 | if ((dev = bpq_get_ether_dev(dev)) == NULL) { |
289 | dev->stats.tx_dropped++; | 289 | orig_dev->stats.tx_dropped++; |
290 | kfree_skb(skb); | 290 | kfree_skb(skb); |
291 | return NETDEV_TX_OK; | 291 | return NETDEV_TX_OK; |
292 | } | 292 | } |
@@ -552,7 +552,7 @@ static int bpq_device_event(struct notifier_block *this,unsigned long event, voi | |||
552 | { | 552 | { |
553 | struct net_device *dev = (struct net_device *)ptr; | 553 | struct net_device *dev = (struct net_device *)ptr; |
554 | 554 | ||
555 | if (dev_net(dev) != &init_net) | 555 | if (!net_eq(dev_net(dev), &init_net)) |
556 | return NOTIFY_DONE; | 556 | return NOTIFY_DONE; |
557 | 557 | ||
558 | if (!dev_is_ethdev(dev)) | 558 | if (!dev_is_ethdev(dev)) |