Skip to content

Commit

Permalink
mac80211: use skb_queue_walk() in mesh_path_assign_nexthop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Pedersen authored and Johannes Berg committed Aug 20, 2012
1 parent aa7a008 commit b22bd52
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/mac80211/mesh_pathtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,17 @@ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta)
{
struct sk_buff *skb;
struct ieee80211_hdr *hdr;
struct sk_buff_head tmpq;
unsigned long flags;

rcu_assign_pointer(mpath->next_hop, sta);

__skb_queue_head_init(&tmpq);

spin_lock_irqsave(&mpath->frame_queue.lock, flags);

while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) {
skb_queue_walk(&mpath->frame_queue, skb) {
hdr = (struct ieee80211_hdr *) skb->data;
memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN);
memcpy(hdr->addr2, mpath->sdata->vif.addr, ETH_ALEN);
__skb_queue_tail(&tmpq, skb);
}

skb_queue_splice(&tmpq, &mpath->frame_queue);
spin_unlock_irqrestore(&mpath->frame_queue.lock, flags);
}

Expand Down

0 comments on commit b22bd52

Please sign in to comment.