hostapd: fix ap+sta issues
authorFelix Fietkau <nbd@openwrt.org>
Wed, 29 Aug 2012 16:06:24 +0000 (16:06 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 29 Aug 2012 16:06:24 +0000 (16:06 +0000)
SVN-Revision: 33311

package/hostapd/patches/450-reload_freq_change.patch
package/hostapd/patches/452-ctrl_iface_reload.patch
package/hostapd/patches/480-terminate_on_setup_failure.patch
package/hostapd/patches/540-dynamic_20_40_mhz.patch
package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch
package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch
package/hostapd/patches/604-wpa_s-support-htmode-param.patch

index b83410be3a1e8283162376603aac15c2e5f89c97..9245860d1e548e022300c9f490b7a4471d3c80bf 100644 (file)
@@ -1,10 +1,20 @@
 --- a/src/ap/hostapd.c
 +++ b/src/ap/hostapd.c
 --- a/src/ap/hostapd.c
 +++ b/src/ap/hostapd.c
-@@ -137,6 +137,10 @@ int hostapd_reload_config(struct hostapd
+@@ -137,6 +137,20 @@ int hostapd_reload_config(struct hostapd
        oldconf = hapd->iconf;
        iface->conf = newconf;
  
        oldconf = hapd->iconf;
        iface->conf = newconf;
  
-+      iface->freq = hostapd_hw_get_freq(hapd, hapd->iconf->channel);
++      hostapd_select_hw_mode(iface);
++      iface->freq = hostapd_hw_get_freq(hapd, newconf->channel);
++
++      if (hostapd_set_freq(hapd, newconf->hw_mode, iface->freq,
++                           newconf->channel,
++                           newconf->ieee80211n,
++                           newconf->secondary_channel)) {
++              wpa_printf(MSG_ERROR, "Could not set channel for "
++                         "kernel driver");
++      }
++
 +      if (iface->current_mode)
 +              hostapd_prepare_rates(iface, iface->current_mode);
 +
 +      if (iface->current_mode)
 +              hostapd_prepare_rates(iface, iface->current_mode);
 +
index cf972fe8ee1bdbf9067c8ca95f29e1bf40dd28f8..c0617eb75f54ace9277fed238ae8cfb0a22b17ea 100644 (file)
@@ -58,7 +58,7 @@
 +                      conf->ht_capab &= atoi(val);
 +              else if ((val = get_option(opt, "sec_chan=")))
 +                      conf->secondary_channel = atoi(val);
 +                      conf->ht_capab &= atoi(val);
 +              else if ((val = get_option(opt, "sec_chan=")))
 +                      conf->secondary_channel = atoi(val);
-+              else if ((val = get_option(opt, "hwmode=")))
++              else if ((val = get_option(opt, "hw_mode=")))
 +                      conf->hw_mode = atoi(val);
 +              else if ((val = get_option(opt, "ieee80211n=")))
 +                      conf->ieee80211n = atoi(val);
 +                      conf->hw_mode = atoi(val);
 +              else if ((val = get_option(opt, "ieee80211n=")))
 +                      conf->ieee80211n = atoi(val);
index 13a7cdb80f665bebcaf6dcd2ab64c8100f0a1489..31ce3eb929880a2da89d78542546a60348cbc332 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/ap/hostapd.c
 +++ b/src/ap/hostapd.c
 --- a/src/ap/hostapd.c
 +++ b/src/ap/hostapd.c
-@@ -768,11 +768,8 @@ int hostapd_setup_interface_complete(str
+@@ -778,11 +778,8 @@ int hostapd_setup_interface_complete(str
        size_t j;
        u8 *prev_addr;
  
        size_t j;
        u8 *prev_addr;
  
@@ -14,7 +14,7 @@
  
        wpa_printf(MSG_DEBUG, "Completing interface initialization");
        if (hapd->iconf->channel) {
  
        wpa_printf(MSG_DEBUG, "Completing interface initialization");
        if (hapd->iconf->channel) {
-@@ -788,7 +785,7 @@ int hostapd_setup_interface_complete(str
+@@ -798,7 +795,7 @@ int hostapd_setup_interface_complete(str
                                     hapd->iconf->secondary_channel)) {
                        wpa_printf(MSG_ERROR, "Could not set channel for "
                                   "kernel driver");
                                     hapd->iconf->secondary_channel)) {
                        wpa_printf(MSG_ERROR, "Could not set channel for "
                                   "kernel driver");
@@ -23,7 +23,7 @@
                }
        }
  
                }
        }
  
-@@ -799,7 +796,7 @@ int hostapd_setup_interface_complete(str
+@@ -809,7 +806,7 @@ int hostapd_setup_interface_complete(str
                        hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
                                       HOSTAPD_LEVEL_WARNING,
                                       "Failed to prepare rates table.");
                        hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
                                       HOSTAPD_LEVEL_WARNING,
                                       "Failed to prepare rates table.");
@@ -32,7 +32,7 @@
                }
        }
  
                }
        }
  
-@@ -807,14 +804,14 @@ int hostapd_setup_interface_complete(str
+@@ -817,14 +814,14 @@ int hostapd_setup_interface_complete(str
            hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) {
                wpa_printf(MSG_ERROR, "Could not set RTS threshold for "
                           "kernel driver");
            hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) {
                wpa_printf(MSG_ERROR, "Could not set RTS threshold for "
                           "kernel driver");
@@ -49,7 +49,7 @@
        }
  
        prev_addr = hapd->own_addr;
        }
  
        prev_addr = hapd->own_addr;
-@@ -824,7 +821,7 @@ int hostapd_setup_interface_complete(str
+@@ -834,7 +831,7 @@ int hostapd_setup_interface_complete(str
                if (j)
                        os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN);
                if (hostapd_setup_bss(hapd, j == 0))
                if (j)
                        os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN);
                if (hostapd_setup_bss(hapd, j == 0))
@@ -58,7 +58,7 @@
                if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0)
                        prev_addr = hapd->own_addr;
        }
                if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0)
                        prev_addr = hapd->own_addr;
        }
-@@ -836,7 +833,7 @@ int hostapd_setup_interface_complete(str
+@@ -846,7 +843,7 @@ int hostapd_setup_interface_complete(str
        if (hostapd_driver_commit(hapd) < 0) {
                wpa_printf(MSG_ERROR, "%s: Failed to commit driver "
                           "configuration", __func__);
        if (hostapd_driver_commit(hapd) < 0) {
                wpa_printf(MSG_ERROR, "%s: Failed to commit driver "
                           "configuration", __func__);
@@ -67,7 +67,7 @@
        }
  
        /*
        }
  
        /*
-@@ -860,6 +857,11 @@ int hostapd_setup_interface_complete(str
+@@ -870,6 +867,11 @@ int hostapd_setup_interface_complete(str
                iface->init_complete(iface);
  
        return 0;
                iface->init_complete(iface);
  
        return 0;
index 08750b0158fd635ab4a7e1ef8d45beb18ff4db21..420fcc6bf6cce2e58ca81bb06fe37332f3c62139 100644 (file)
@@ -31,7 +31,7 @@
  #include "ieee802_11_auth.h"
  #include "vlan_init.h"
  #include "wpa_auth.h"
  #include "ieee802_11_auth.h"
  #include "vlan_init.h"
  #include "wpa_auth.h"
-@@ -307,6 +308,7 @@ static void hostapd_cleanup_iface_pre(st
+@@ -317,6 +318,7 @@ static void hostapd_cleanup_iface_pre(st
  
  static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
  {
  
  static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
  {
index a1fde052f9ffc4b1939bb15b9d858003aaa0b31b..447f480d1f70bd8d369e05e70b28a5d0d72b42b8 100644 (file)
@@ -12,8 +12,6 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  wpa_supplicant/wpa_supplicant.c |   23 +++++++---
  4 files changed, 124 insertions(+), 7 deletions(-)
 
  wpa_supplicant/wpa_supplicant.c |   23 +++++++---
  4 files changed, 124 insertions(+), 7 deletions(-)
 
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 5ee92f7..d204148 100644
 --- a/src/drivers/driver.h
 +++ b/src/drivers/driver.h
 @@ -19,6 +19,7 @@
 --- a/src/drivers/driver.h
 +++ b/src/drivers/driver.h
 @@ -19,6 +19,7 @@
@@ -36,8 +34,6 @@ index 5ee92f7..d204148 100644
        /**
         * bg_scan_period - Background scan period in seconds, 0 to disable
         * background scan, or -1 to indicate no change to default driver
        /**
         * bg_scan_period - Background scan period in seconds, 0 to disable
         * background scan, or -1 to indicate no change to default driver
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index c423bc3..be566ee 100644
 --- a/wpa_supplicant/config.c
 +++ b/wpa_supplicant/config.c
 @@ -14,6 +14,7 @@
 --- a/wpa_supplicant/config.c
 +++ b/wpa_supplicant/config.c
 @@ -14,6 +14,7 @@
@@ -48,7 +44,7 @@ index c423bc3..be566ee 100644
  #include "config.h"
  
  
  #include "config.h"
  
  
-@@ -1431,6 +1432,97 @@ static char * wpa_config_write_p2p_client_list(const struct parse_data *data,
+@@ -1431,6 +1432,97 @@ static char * wpa_config_write_p2p_clien
  
  #endif /* CONFIG_P2P */
  
  
  #endif /* CONFIG_P2P */
  
@@ -146,7 +142,7 @@ index c423bc3..be566ee 100644
  /* Helper macros for network block parser */
  
  #ifdef OFFSET
  /* Helper macros for network block parser */
  
  #ifdef OFFSET
-@@ -1605,6 +1697,10 @@ static const struct parse_data ssid_fields[] = {
+@@ -1605,6 +1697,10 @@ static const struct parse_data ssid_fiel
        { STR(ht_mcs) },
  #endif /* CONFIG_HT_OVERRIDES */
        { INT(ap_max_inactivity) },
        { STR(ht_mcs) },
  #endif /* CONFIG_HT_OVERRIDES */
        { INT(ap_max_inactivity) },
@@ -157,8 +153,6 @@ index c423bc3..be566ee 100644
  };
  
  #undef OFFSET
  };
  
  #undef OFFSET
-diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
-index 80d4382..8d152a4 100644
 --- a/wpa_supplicant/config_ssid.h
 +++ b/wpa_supplicant/config_ssid.h
 @@ -11,6 +11,7 @@
 --- a/wpa_supplicant/config_ssid.h
 +++ b/wpa_supplicant/config_ssid.h
 @@ -11,6 +11,7 @@
@@ -181,11 +175,9 @@ index 80d4382..8d152a4 100644
  };
  
  #endif /* CONFIG_SSID_H */
  };
  
  #endif /* CONFIG_SSID_H */
-diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
-index cc85f1e..1473d91 100644
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -1395,15 +1395,24 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
+@@ -1395,15 +1395,24 @@ void wpa_supplicant_associate(struct wpa
                params.ssid_len = ssid->ssid_len;
        }
  
                params.ssid_len = ssid->ssid_len;
        }
  
@@ -217,6 +209,3 @@ index cc85f1e..1473d91 100644
        params.wpa_ie = wpa_ie;
        params.wpa_ie_len = wpa_ie_len;
        params.pairwise_suite = cipher_pairwise;
        params.wpa_ie = wpa_ie;
        params.wpa_ie_len = wpa_ie_len;
        params.pairwise_suite = cipher_pairwise;
--- 
-1.7.9.4
-
index 5f4df23ebef9058b8c69e25f610639496d7e43a1..28eba21d95eacfb4429013eb3b5f949e2854707c 100644 (file)
@@ -8,11 +8,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  src/drivers/driver_nl80211.c |   33 ++++++++++++++++++++++++++++++++-
  1 file changed, 32 insertions(+), 1 deletion(-)
 
  src/drivers/driver_nl80211.c |   33 ++++++++++++++++++++++++++++++++-
  1 file changed, 32 insertions(+), 1 deletion(-)
 
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 22e7075..f510d18 100644
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -6481,7 +6481,7 @@ static int wpa_driver_nl80211_ibss(struct wpa_driver_nl80211_data *drv,
+@@ -6481,7 +6481,7 @@ static int wpa_driver_nl80211_ibss(struc
                                   struct wpa_driver_associate_params *params)
  {
        struct nl_msg *msg;
                                   struct wpa_driver_associate_params *params)
  {
        struct nl_msg *msg;
@@ -59,6 +57,3 @@ index 22e7075..f510d18 100644
        ret = nl80211_set_conn_keys(params, msg);
        if (ret)
                goto nla_put_failure;
        ret = nl80211_set_conn_keys(params, msg);
        if (ret)
                goto nla_put_failure;
--- 
-1.7.9.4
-
index 7e1a7a072fa923e5078a2f72254da4c4a334e535..e540d453349666c4aa03d56662220151b18dbb44 100644 (file)
@@ -14,8 +14,6 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  wpa_supplicant/wpa_supplicant.c |    2 ++
  5 files changed, 88 insertions(+)
 
  wpa_supplicant/wpa_supplicant.c |    2 ++
  5 files changed, 88 insertions(+)
 
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index dda2fbc..28bd181 100644
 --- a/src/drivers/driver.h
 +++ b/src/drivers/driver.h
 @@ -337,6 +337,8 @@ struct wpa_driver_associate_params {
 --- a/src/drivers/driver.h
 +++ b/src/drivers/driver.h
 @@ -337,6 +337,8 @@ struct wpa_driver_associate_params {
@@ -27,11 +25,9 @@ index dda2fbc..28bd181 100644
  
        /**
         * bg_scan_period - Background scan period in seconds, 0 to disable
  
        /**
         * bg_scan_period - Background scan period in seconds, 0 to disable
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 9783c96..d1257a7 100644
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -6493,6 +6493,22 @@ retry:
+@@ -6545,6 +6545,22 @@ retry:
                NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
        }
  
                NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
        }
  
@@ -54,11 +50,9 @@ index 9783c96..d1257a7 100644
        ret = nl80211_set_conn_keys(params, msg);
        if (ret)
                goto nla_put_failure;
        ret = nl80211_set_conn_keys(params, msg);
        if (ret)
                goto nla_put_failure;
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index 3d6c0e6..d96b2ea 100644
 --- a/wpa_supplicant/config.c
 +++ b/wpa_supplicant/config.c
 --- a/wpa_supplicant/config.c
 +++ b/wpa_supplicant/config.c
-@@ -1468,6 +1468,71 @@ static char * wpa_config_write_mcast_rate(const struct parse_data *data,
+@@ -1463,6 +1463,71 @@ static char * wpa_config_write_mcast_rat
  }
  #endif /* NO_CONFIG_WRITE */
  
  }
  #endif /* NO_CONFIG_WRITE */
  
@@ -130,7 +124,7 @@ index 3d6c0e6..d96b2ea 100644
  static int wpa_config_parse_rates(const struct parse_data *data,
                                  struct wpa_ssid *ssid, int line,
                                  const char *value)
  static int wpa_config_parse_rates(const struct parse_data *data,
                                  struct wpa_ssid *ssid, int line,
                                  const char *value)
-@@ -1706,6 +1771,7 @@ static const struct parse_data ssid_fields[] = {
+@@ -1701,6 +1766,7 @@ static const struct parse_data ssid_fiel
        { INT_RANGE(beacon_interval, 0, 1000) },
        { FUNC(rates) },
        { FUNC(mcast_rate) },
        { INT_RANGE(beacon_interval, 0, 1000) },
        { FUNC(rates) },
        { FUNC(mcast_rate) },
@@ -138,8 +132,6 @@ index 3d6c0e6..d96b2ea 100644
  };
  
  #undef OFFSET
  };
  
  #undef OFFSET
-diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
-index 8d152a4..7143277 100644
 --- a/wpa_supplicant/config_ssid.h
 +++ b/wpa_supplicant/config_ssid.h
 @@ -505,6 +505,8 @@ struct wpa_ssid {
 --- a/wpa_supplicant/config_ssid.h
 +++ b/wpa_supplicant/config_ssid.h
 @@ -505,6 +505,8 @@ struct wpa_ssid {
@@ -151,11 +143,9 @@ index 8d152a4..7143277 100644
  };
  
  #endif /* CONFIG_SSID_H */
  };
  
  #endif /* CONFIG_SSID_H */
-diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
-index 59efa16..fc8762f 100644
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -1379,6 +1379,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
+@@ -1411,6 +1411,8 @@ void wpa_supplicant_associate(struct wpa
                        i++;
                }
                params.mcast_rate = ssid->mcast_rate;
                        i++;
                }
                params.mcast_rate = ssid->mcast_rate;
@@ -164,6 +154,3 @@ index 59efa16..fc8762f 100644
        }
  
        params.wpa_ie = wpa_ie;
        }
  
        params.wpa_ie = wpa_ie;
--- 
-1.7.9.4
-