WPS: Set currently used RF band in RF Bands attribute
[mech_eap.git] / src / wps / wps_dev_attr.c
index 7a7c099..1b12b5a 100644 (file)
@@ -217,12 +217,13 @@ int wps_build_vendor_ext_m1(struct wps_device_data *dev, struct wpabuf *msg)
 }
 
 
-int wps_build_rf_bands(struct wps_device_data *dev, struct wpabuf *msg)
+int wps_build_rf_bands(struct wps_device_data *dev, struct wpabuf *msg,
+                      u8 rf_band)
 {
        wpa_printf(MSG_DEBUG, "WPS:  * RF Bands (%x)", dev->rf_bands);
        wpabuf_put_be16(msg, ATTR_RF_BANDS);
        wpabuf_put_be16(msg, 1);
-       wpabuf_put_u8(msg, dev->rf_bands);
+       wpabuf_put_u8(msg, rf_band ? rf_band : dev->rf_bands);
        return 0;
 }