hostapd: fix segmentation fault on non-mac80211 drivers (#7202)
authorFelix Fietkau <nbd@openwrt.org>
Tue, 20 Apr 2010 21:25:14 +0000 (21:25 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 20 Apr 2010 21:25:14 +0000 (21:25 +0000)
SVN-Revision: 21065

package/hostapd/patches/370-basic_rates.patch

index 674e232f54c9deba6af425b4b03bb66d0c603316..ef4691bbd67ace9ad0c7185819706f9497908740 100644 (file)
@@ -1,15 +1,17 @@
 --- a/src/ap/hostapd.c
 +++ b/src/ap/hostapd.c
-@@ -707,6 +707,14 @@ int hostapd_setup_interface_complete(str
+@@ -707,6 +707,16 @@ int hostapd_setup_interface_complete(str
                }
        }
  
-+      if (hostapd_prepare_rates(hapd, iface->current_mode)) {
-+              wpa_printf(MSG_ERROR, "Failed to prepare rates table.");
-+              hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
++      if (iface->current_mode) {
++              if (hostapd_prepare_rates(hapd, iface->current_mode)) {
++                      wpa_printf(MSG_ERROR, "Failed to prepare rates table.");
++                      hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
 +                                         HOSTAPD_LEVEL_WARNING,
 +                                         "Failed to prepare rates table.");
-+              return -1;
++                      return -1;
++              }
 +      }
 +
        if (hapd->iconf->rts_threshold > -1 &&