linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Fix incorrectly named last_hop_metric variable in mesh_rx_path_sel_frame
@ 2015-06-05 19:43 Alexis Green
  2015-06-09 19:53 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Alexis Green @ 2015-06-05 19:43 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Jesse Jones

The last hop metric should refer to link cost (this is how
hwmp_route_info_get uses it for example). But in mesh_rx_path_sel_frame
we are not dealing with link cost but with the total cost to the origin
of a PREQ or PREP.

Signed-off-by: Alexis Green <agreen@cococorp.com>
CC: Jesse Jones <jjones@cococorp.com>

---

diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 214e63b..be33e41 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -854,7 +854,7 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata,
 {
 	struct ieee802_11_elems elems;
 	size_t baselen;
-	u32 last_hop_metric;
+	u32 path_metric;
 	struct sta_info *sta;
 
 	/* need action_code */
@@ -877,21 +877,21 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata,
 		if (elems.preq_len != 37)
 			/* Right now we support just 1 destination and no AE */
 			return;
-		last_hop_metric = hwmp_route_info_get(sdata, mgmt, elems.preq,
-						      MPATH_PREQ);
-		if (last_hop_metric)
+		path_metric = hwmp_route_info_get(sdata, mgmt, elems.preq,
+						  MPATH_PREQ);
+		if (path_metric)
 			hwmp_preq_frame_process(sdata, mgmt, elems.preq,
-						last_hop_metric);
+						path_metric);
 	}
 	if (elems.prep) {
 		if (elems.prep_len != 31)
 			/* Right now we support no AE */
 			return;
-		last_hop_metric = hwmp_route_info_get(sdata, mgmt, elems.prep,
-						      MPATH_PREP);
-		if (last_hop_metric)
+		path_metric = hwmp_route_info_get(sdata, mgmt, elems.prep,
+						  MPATH_PREP);
+		if (path_metric)
 			hwmp_prep_frame_process(sdata, mgmt, elems.prep,
-						last_hop_metric);
+						path_metric);
 	}
 	if (elems.perr) {
 		if (elems.perr_len != 15)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: Fix incorrectly named last_hop_metric variable in mesh_rx_path_sel_frame
  2015-06-05 19:43 [PATCH] mac80211: Fix incorrectly named last_hop_metric variable in mesh_rx_path_sel_frame Alexis Green
@ 2015-06-09 19:53 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-06-09 19:53 UTC (permalink / raw)
  To: agreen; +Cc: linux-wireless, Jesse Jones

On Fri, 2015-06-05 at 12:43 -0700, Alexis Green wrote:
> The last hop metric should refer to link cost (this is how
> hwmp_route_info_get uses it for example). But in mesh_rx_path_sel_frame
> we are not dealing with link cost but with the total cost to the origin
> of a PREQ or PREP.
> 
> Signed-off-by: Alexis Green <agreen@cococorp.com>
> CC: Jesse Jones <jjones@cococorp.com>

Applied. This one worked, but the other ones you sent didn't.

johannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-09 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-05 19:43 [PATCH] mac80211: Fix incorrectly named last_hop_metric variable in mesh_rx_path_sel_frame Alexis Green
2015-06-09 19:53 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).