]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: For VHT 20/40, allow center segment 0 to be zero
authorJohannes Berg <johannes.berg@intel.com>
Fri, 14 Mar 2014 14:45:21 +0000 (16:45 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 14 Mar 2014 15:07:17 +0000 (17:07 +0200)
The 802.11ac amendment specifies that that the center segment 0 field
is reserved, so it should be zero. Hostapd previously required it to
be set, which is likely a good idea for interoperability, but allow it
to be unset. However, don't allow it to be set to a random value, only
allow zero and the correct channel.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
src/ap/ap_drv_ops.c

index 5ba48c9d1b602dfeb49017b7c6c7f5b610684761..83cfd0f4c5ce3424efa6696fb888b9555a05535d 100644 (file)
@@ -503,7 +503,8 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, int mode,
        case VHT_CHANWIDTH_USE_HT:
                if (center_segment1)
                        return -1;
-               if (5000 + center_segment0 * 5 != data->center_freq1 &&
+               if (center_segment0 != 0 &&
+                   5000 + center_segment0 * 5 != data->center_freq1 &&
                    2407 + center_segment0 * 5 != data->center_freq1)
                        return -1;
                break;