summaryrefslogtreecommitdiff
path: root/net/mac80211/mesh_pathtbl.c
AgeCommit message (Collapse)Author
2008-05-12Fix potential scheduling while atomic in mesh_path_add.Pavel Emelyanov
Calling synchronize_rcu() under write-lock-ed pathtbl_resize_lock may result in this warning (and other side effects). It looks safe just dropping this lock before calling synchronize_rcu. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-05-12Fix not checked kmalloc() result.Pavel Emelyanov
The new_node kmallocation is not checked for success, so add this check. BTW, it also happens under the read_lock. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-05-12Fix GFP_KERNEL allocation under read lock.Pavel Emelyanov
The mesh_path_add() read-locks the pathtbl_resize_lock and calls kmalloc with GFP_KERNEL mask. Fix it and move the endadd2 label lower. It should be _before_ the if() beyond, but it makes no sense for it being there, so I move it right after this if(). Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-06mac80211: fix mesh_path and sta_info get_by_idx functionsLuis Carlos Cobo
Skip properly entries whose dev does not match. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-06mac80211: add PLINK_ prefix and kernel doc to enum plink_stateLuis Carlos Cobo
Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-06mac80211: always force mesh_path deletionsLuis Carlos Cobo
Postponing the deletion is not really useful anymore. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-06mac80211: delete mesh_path timer on mesh_path removalLuis Carlos Cobo
This avoids dereferencing a no longer existing struct mesh_path. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-06mac80211: don't clear next_hop in path reclaimJohannes Berg
Luis pointed out that this path is going to be freed right away anyway so there's no point in assigning next_hop. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Cc: Luis Carlos Cobo <luisca@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-06mac80211: RCU-ify STA info structure accessJohannes Berg
This makes access to the STA hash table/list use RCU to protect against freeing of items. However, it's not a true RCU, the copy step is missing: whenever somebody changes a STA item it is simply updated. This is an existing race condition that is now somewhat understandable. This patch also fixes the race key freeing vs. STA destruction by making sure that sta_info_destroy() is always called under RTNL and frees the key. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-06mac80211: export mesh_plink_brokenJohannes Berg
This needs to be exported because rate control algorithms can be modular. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-06mac80211: mesh path table implementationLuis Carlos Cobo
The mesh path table associates destinations with the next hop to reach them. The table is a hash of linked lists protected by rcu mechanisms. Every mesh path contains a lock to protect the mesh path state. Each outgoing mesh frame requires a look up into this table. Therefore, the table it has been designed so it is not necessary to hold any lock to find the appropriate next hop. If the path is determined to be active within a rcu context we can safely dereference mpath->next_hop->addr, since it holds a reference to the sta next_hop. After a mesh path has been set active for the first time it next_hop must always point to a valid sta. If this is not possible the mpath must be deleted or replaced in a RCU safe fashion. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>