aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChun-Yeow Yeoh <yeohchunyeow@gmail.com>2012-03-19 09:38:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-09 16:12:30 -0400
commit292c41acddfdbe0fb42d4c4ad9b896168fd16e91 (patch)
treeb7fa07a43ca2362ee491dd2d72bf13be58e93e32
parent70b12f2612a6b352d16342b5952cf9f9de6c1d56 (diff)
mac80211: fix the sparse warnings on endian handling in RANN propagation
The HWMP sequence number of received RANN element is compared to decide whether to be propagated. The sequence number is required to covert from 32bit little endian data into CPUs endianness for comparison. The same applies to the RANN metric. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/linux/ieee80211.h6
-rw-r--r--net/mac80211/mesh_hwmp.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index a8c1c46431ab..09301b0768d0 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -640,9 +640,9 @@ struct ieee80211_rann_ie {
640 u8 rann_hopcount; 640 u8 rann_hopcount;
641 u8 rann_ttl; 641 u8 rann_ttl;
642 u8 rann_addr[6]; 642 u8 rann_addr[6];
643 u32 rann_seq; 643 __le32 rann_seq;
644 u32 rann_interval; 644 __le32 rann_interval;
645 u32 rann_metric; 645 __le32 rann_metric;
646} __attribute__ ((packed)); 646} __attribute__ ((packed));
647 647
648enum ieee80211_rann_flags { 648enum ieee80211_rann_flags {
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 1c6f3d02aebf..f80a9e3da359 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -748,10 +748,10 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
748 flags = rann->rann_flags; 748 flags = rann->rann_flags;
749 root_is_gate = !!(flags & RANN_FLAG_IS_GATE); 749 root_is_gate = !!(flags & RANN_FLAG_IS_GATE);
750 orig_addr = rann->rann_addr; 750 orig_addr = rann->rann_addr;
751 orig_sn = rann->rann_seq; 751 orig_sn = le32_to_cpu(rann->rann_seq);
752 hopcount = rann->rann_hopcount; 752 hopcount = rann->rann_hopcount;
753 hopcount++; 753 hopcount++;
754 metric = rann->rann_metric; 754 metric = le32_to_cpu(rann->rann_metric);
755 755
756 /* Ignore our own RANNs */ 756 /* Ignore our own RANNs */
757 if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0) 757 if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0)