mac80211: properly forward the RANN IE
authorRui Paulo <rpaulo@gmail.com>
Mon, 9 Nov 2009 23:46:51 +0000 (23:46 +0000)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Nov 2009 22:43:55 +0000 (17:43 -0500)
Increase hopcount and convert metric to LE before forwarding the RANN
action frame.

Signed-off-by: Rui Paulo <rpaulo@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Reviewed-by: Andrey Yurovsky <andrey@cozybit.com>
Tested-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mesh_hwmp.c

index eb4180bff575cddd8da778cd30a0e3212b9af3bc..7d36f3a741a57c3ea37490f05403574ca10379ed 100644 (file)
@@ -686,6 +686,7 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
        orig_addr = rann->rann_addr;
        orig_dsn = rann->rann_seq;
        hopcount = rann->rann_hopcount;
+       hopcount++;
        metric = rann->rann_metric;
        mhwmp_dbg("received RANN from %pM\n", orig_addr);
 
@@ -706,7 +707,8 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
                mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr,
                                       cpu_to_le32(orig_dsn),
                                       0, NULL, 0, sdata->dev->broadcast,
-                                      hopcount, ttl, 0, cpu_to_le32(metric),
+                                      hopcount, ttl, 0,
+                                      cpu_to_le32(metric + mpath->metric),
                                       0, sdata);
                mpath->dsn = orig_dsn;
        }