1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-20 02:35:20 +02:00
openwrt-xburst/package/madwifi/patches/372-queue_vif.patch
nbd c1fc2dd11e madwifi: fix a node refcounting imbalance with a low (but nonzero) crash probability
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12950 3c298f89-4303-0410-b956-a3cf2f4a3e73
2008-10-11 01:56:27 +00:00

40 lines
1.1 KiB
Diff

--- a/net80211/ieee80211_input.c
+++ b/net80211/ieee80211_input.c
@@ -1199,6 +1199,7 @@
}
if (skb1 != NULL) {
struct ieee80211_node *ni_tmp;
+ int ret;
skb1->dev = dev;
skb_reset_mac_header(skb1);
skb_set_network_header(skb1, sizeof(struct ether_header));
@@ -1206,7 +1207,12 @@
skb1->protocol = __constant_htons(ETH_P_802_2);
/* XXX insert vlan tag before queue it? */
ni_tmp = SKB_CB(skb1)->ni; /* remember node so we can free it */
- if (dev_queue_xmit(skb1) == NET_XMIT_DROP) {
+ ret = dev->hard_start_xmit(skb1, dev);
+
+ if (ret == NETDEV_TX_BUSY)
+ ieee80211_dev_kfree_skb(&skb1);
+
+ else if (ret != NETDEV_TX_OK) {
/* If queue dropped the packet because device was
* too busy */
vap->iv_devstats.tx_dropped++;
--- a/net80211/ieee80211_output.c
+++ b/net80211/ieee80211_output.c
@@ -333,9 +333,10 @@
/* Dispatch the packet to the parent device */
skb->dev = vap->iv_ic->ic_dev;
- if (dev_queue_xmit(skb) == NET_XMIT_DROP)
+ if (netif_queue_stopped(skb->dev))
+ ieee80211_dev_kfree_skb(&skb);
+ else if (dev_queue_xmit(skb) == NET_XMIT_DROP)
vap->iv_devstats.tx_dropped++;
-
}
/*