diff options
author | Javier Cardona <javier@cozybit.com> | 2009-07-09 17:42:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:07 -0400 |
commit | 10c836d7896e9d7b683a76f3cac3c289d8da72ef (patch) | |
tree | e68ed929565d3960f6d431d353fc41932f410fdf | |
parent | 4bde0f7d1dca0a7d886997eb8dee3fb47a6484e4 (diff) |
mac80211: Assign next hop address to pending mesh frames
Assign next hop address to pending mesh frames once the path is resolved.
Regression. Frames transmitted when a mesh path was wating to be resolved were
being transmitted with an invalid Receiver Address.
[Changes since v1]
Suggested by Johannes:
- Improved frame_queue traversal
- Narower RCU scope
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 479597e88583..f0304bfdcdff 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
@@ -55,7 +55,25 @@ static DEFINE_RWLOCK(pathtbl_resize_lock); | |||
55 | */ | 55 | */ |
56 | void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta) | 56 | void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta) |
57 | { | 57 | { |
58 | struct sk_buff *skb; | ||
59 | struct ieee80211_hdr *hdr; | ||
60 | struct sk_buff_head tmpq; | ||
61 | unsigned long flags; | ||
62 | |||
58 | rcu_assign_pointer(mpath->next_hop, sta); | 63 | rcu_assign_pointer(mpath->next_hop, sta); |
64 | |||
65 | __skb_queue_head_init(&tmpq); | ||
66 | |||
67 | spin_lock_irqsave(&mpath->frame_queue.lock, flags); | ||
68 | |||
69 | while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) { | ||
70 | hdr = (struct ieee80211_hdr *) skb->data; | ||
71 | memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); | ||
72 | __skb_queue_tail(&tmpq, skb); | ||
73 | } | ||
74 | |||
75 | skb_queue_splice(&tmpq, &mpath->frame_queue); | ||
76 | spin_unlock_irqrestore(&mpath->frame_queue.lock, flags); | ||
59 | } | 77 | } |
60 | 78 | ||
61 | 79 | ||