From 64c92c0757f015c083f873652dbf63155c3a68bf Mon Sep 17 00:00:00 2001 From: vamsi krishna Date: Fri, 23 Sep 2016 18:24:13 +0530 Subject: [PATCH] MBO: Do not parse reason_detail in non_pref_chan attr (AP) The reason detail field was removed from non_pref_chan attr in MBO v0.0_r25 draft. Don't parse for this element to be compliant with the latest drafr. Signed-off-by: Jouni Malinen --- src/ap/mbo_ap.c | 17 ++++++++--------- src/ap/sta_info.h | 1 - 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/ap/mbo_ap.c b/src/ap/mbo_ap.c index 5e0f92a9f..43b0bf169 100644 --- a/src/ap/mbo_ap.c +++ b/src/ap/mbo_ap.c @@ -38,17 +38,16 @@ static void mbo_ap_parse_non_pref_chan(struct sta_info *sta, size_t num_chan, i; int ret; - if (len <= 4) + if (len <= 3) return; /* Not enough room for any channels */ - num_chan = len - 4; + num_chan = len - 3; info = os_zalloc(sizeof(*info) + num_chan); if (!info) return; info->op_class = buf[0]; - info->pref = buf[len - 3]; - info->reason_code = buf[len - 2]; - info->reason_detail = buf[len - 1]; + info->pref = buf[len - 2]; + info->reason_code = buf[len - 1]; info->num_channels = num_chan; buf++; os_memcpy(info->channels, buf, num_chan); @@ -75,9 +74,9 @@ static void mbo_ap_parse_non_pref_chan(struct sta_info *sta, } wpa_printf(MSG_DEBUG, "MBO: STA " MACSTR - " non-preferred channel list (op class %u, pref %u, reason code %u, reason detail %u, channels %s)", + " non-preferred channel list (op class %u, pref %u, reason code %u, channels %s)", MAC2STR(sta->addr), info->op_class, info->pref, - info->reason_code, info->reason_detail, channels); + info->reason_code, channels); } @@ -133,9 +132,9 @@ int mbo_ap_get_info(struct sta_info *sta, char *buf, size_t buflen) char *pos2 = pos; ret = os_snprintf(pos2, end - pos2, - "non_pref_chan[%u]=%u:%u:%u:%u:", + "non_pref_chan[%u]=%u:%u:%u:", count, info->op_class, info->pref, - info->reason_code, info->reason_detail); + info->reason_code); count++; if (os_snprintf_error(end - pos2, ret)) break; diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h index d0e43be5d..099de62d1 100644 --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h @@ -52,7 +52,6 @@ struct mbo_non_pref_chan_info { u8 op_class; u8 pref; u8 reason_code; - u8 reason_detail; u8 num_channels; u8 channels[]; };