diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2012-08-09 21:15:39 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-08-20 07:25:05 -0400 |
commit | b22bd5221cfe80ee3d345d9deccfd29edf9bafb4 (patch) | |
tree | 4ce0db440e12757c936cbef13c804bb169a4643f /net/mac80211 | |
parent | aa7a00809cf6afe3cd6f5af2889110b47b798667 (diff) |
mac80211: use skb_queue_walk() in mesh_path_assign_nexthop
Since all we really want is just to iterate over all skbs, do just that
and avoid (de)queueing to a clusmy tmpq.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index bec7b281b5ba..b819d6b847d0 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
@@ -203,23 +203,17 @@ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta) | |||
203 | { | 203 | { |
204 | struct sk_buff *skb; | 204 | struct sk_buff *skb; |
205 | struct ieee80211_hdr *hdr; | 205 | struct ieee80211_hdr *hdr; |
206 | struct sk_buff_head tmpq; | ||
207 | unsigned long flags; | 206 | unsigned long flags; |
208 | 207 | ||
209 | rcu_assign_pointer(mpath->next_hop, sta); | 208 | rcu_assign_pointer(mpath->next_hop, sta); |
210 | 209 | ||
211 | __skb_queue_head_init(&tmpq); | ||
212 | |||
213 | spin_lock_irqsave(&mpath->frame_queue.lock, flags); | 210 | spin_lock_irqsave(&mpath->frame_queue.lock, flags); |
214 | 211 | skb_queue_walk(&mpath->frame_queue, skb) { | |
215 | while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) { | ||
216 | hdr = (struct ieee80211_hdr *) skb->data; | 212 | hdr = (struct ieee80211_hdr *) skb->data; |
217 | memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); | 213 | memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); |
218 | memcpy(hdr->addr2, mpath->sdata->vif.addr, ETH_ALEN); | 214 | memcpy(hdr->addr2, mpath->sdata->vif.addr, ETH_ALEN); |
219 | __skb_queue_tail(&tmpq, skb); | ||
220 | } | 215 | } |
221 | 216 | ||
222 | skb_queue_splice(&tmpq, &mpath->frame_queue); | ||
223 | spin_unlock_irqrestore(&mpath->frame_queue.lock, flags); | 217 | spin_unlock_irqrestore(&mpath->frame_queue.lock, flags); |
224 | } | 218 | } |
225 | 219 | ||