diff options
author | KN | 2020-06-09 16:50:48 -0500 |
---|---|---|
committer | KN | 2020-06-09 16:50:48 -0500 |
commit | c0d9b775e285e0a5ad3c4b7cfe2c5ad7f5adb319 (patch) | |
tree | 278e66ffc8e381179898856dc28ef9257d306264 | |
parent | 1c6a7293fc57814be5154c4bf0299cba5e610996 (diff) | |
download | hostap-upstream_29_rebase.tar.gz hostap-upstream_29_rebase.tar.xz hostap-upstream_29_rebase.zip |
0048 - This patch not allow to load AP on JP-only channel 14, 38, 42, and 46.HEADR8.8_RC1R8.8upstream_29_rebasemaster
Signed-off-by: KN <sudharshan@ti.com>
-rw-r--r-- | src/ap/hw_features.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index 5ed8defdd..9f6f17ab3 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c | |||
@@ -739,7 +739,7 @@ static int hostapd_is_usable_chan(struct hostapd_iface *iface, | |||
739 | int channel, int primary) | 739 | int channel, int primary) |
740 | { | 740 | { |
741 | struct hostapd_channel_data *chan; | 741 | struct hostapd_channel_data *chan; |
742 | 742 | int c; | |
743 | if (!iface->current_mode) | 743 | if (!iface->current_mode) |
744 | return 0; | 744 | return 0; |
745 | 745 | ||
@@ -747,6 +747,18 @@ static int hostapd_is_usable_chan(struct hostapd_iface *iface, | |||
747 | if (!chan) | 747 | if (!chan) |
748 | return 0; | 748 | return 0; |
749 | 749 | ||
750 | c = chan->chan; | ||
751 | |||
752 | /* skip channels 38, 42, 46 if country is not JP */ | ||
753 | if (!os_memcmp(iface->conf->country, "JP", 2) == 0) | ||
754 | { | ||
755 | if (c == 38 || c == 42 || c == 46) | ||
756 | { | ||
757 | wpa_printf(MSG_INFO, "Channel %d not allowed for AP mode in this country code",c); | ||
758 | return 0; | ||
759 | } | ||
760 | } | ||
761 | |||
750 | if ((primary && chan_pri_allowed(chan)) || | 762 | if ((primary && chan_pri_allowed(chan)) || |
751 | (!primary && !(chan->flag & HOSTAPD_CHAN_DISABLED))) | 763 | (!primary && !(chan->flag & HOSTAPD_CHAN_DISABLED))) |
752 | return 1; | 764 | return 1; |
@@ -901,7 +913,7 @@ static int valid_ap_channel(struct hostapd_iface *iface, int chan) | |||
901 | return 0; | 913 | return 0; |
902 | 914 | ||
903 | /* don't allow JP-only channels */ | 915 | /* don't allow JP-only channels */ |
904 | if (chan == 38 || chan == 42) | 916 | if (chan == 38 || chan == 42 || chan == 46) |
905 | return 0; | 917 | return 0; |
906 | 918 | ||
907 | /* don't allow channels on the the ACS blacklist */ | 919 | /* don't allow channels on the the ACS blacklist */ |