提交 292c41ac 编写于 作者: C Chun-Yeow Yeoh 提交者: John W. Linville

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: NChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: NJavier Cardona <javier@cozybit.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 70b12f26
......@@ -640,9 +640,9 @@ struct ieee80211_rann_ie {
u8 rann_hopcount;
u8 rann_ttl;
u8 rann_addr[6];
u32 rann_seq;
u32 rann_interval;
u32 rann_metric;
__le32 rann_seq;
__le32 rann_interval;
__le32 rann_metric;
} __attribute__ ((packed));
enum ieee80211_rann_flags {
......
......@@ -748,10 +748,10 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
flags = rann->rann_flags;
root_is_gate = !!(flags & RANN_FLAG_IS_GATE);
orig_addr = rann->rann_addr;
orig_sn = rann->rann_seq;
orig_sn = le32_to_cpu(rann->rann_seq);
hopcount = rann->rann_hopcount;
hopcount++;
metric = rann->rann_metric;
metric = le32_to_cpu(rann->rann_metric);
/* Ignore our own RANNs */
if (compare_ether_addr(orig_addr, sdata->vif.addr) == 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册