]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove WEP support from VLAN
authorMichael Braun <michael-dev@fami-braun.de>
Mon, 5 Oct 2015 14:14:27 +0000 (16:14 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 5 Oct 2015 22:27:27 +0000 (01:27 +0300)
Commit d66dcb0d0b584afdbaba00adcfe661741703094d ('WEP: Remove VLAN
support from hostapd') already removed VLAN support for WEP encryption,
so vlan_setup_encryption_dyn() is no longer needed.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
src/ap/sta_info.c
src/ap/vlan_init.c
src/ap/vlan_init.h

index d8ef858dabcf1747ecb065e8bee03982f11ee02e..500beff31caefef1c82e83a310a730cfe9ea7c47 100644 (file)
@@ -847,41 +847,17 @@ int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta)
                }
 
                iface = vlan->ifname;
-               if (vlan_setup_encryption_dyn(hapd, iface) != 0) {
-                       hostapd_logger(hapd, sta->addr,
-                                      HOSTAPD_MODULE_IEEE80211,
-                                      HOSTAPD_LEVEL_DEBUG, "could not "
-                                      "configure encryption for dynamic VLAN "
-                                      "interface for vlan_id=%d",
-                                      sta->vlan_id);
-               }
-
                hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
                               HOSTAPD_LEVEL_DEBUG, "added new dynamic VLAN "
                               "interface '%s'", iface);
-       } else if (vlan && vlan->vlan_id == sta->vlan_id) {
-               if (vlan->dynamic_vlan > 0) {
-                       vlan->dynamic_vlan++;
-                       hostapd_logger(hapd, sta->addr,
-                                      HOSTAPD_MODULE_IEEE80211,
-                                      HOSTAPD_LEVEL_DEBUG, "updated existing "
-                                      "dynamic VLAN interface '%s'", iface);
-               }
-
-               /*
-                * Update encryption configuration for statically generated
-                * VLAN interface. This is only used for static WEP
-                * configuration for the case where hostapd did not yet know
-                * which keys are to be used when the interface was added.
-                */
-               if (vlan_setup_encryption_dyn(hapd, iface) != 0) {
-                       hostapd_logger(hapd, sta->addr,
-                                      HOSTAPD_MODULE_IEEE80211,
-                                      HOSTAPD_LEVEL_DEBUG, "could not "
-                                      "configure encryption for VLAN "
-                                      "interface for vlan_id=%d",
-                                      sta->vlan_id);
-               }
+       } else if (vlan && vlan->vlan_id == sta->vlan_id &&
+                  vlan->dynamic_vlan > 0) {
+               vlan->dynamic_vlan++;
+               hostapd_logger(hapd, sta->addr,
+                              HOSTAPD_MODULE_IEEE80211,
+                              HOSTAPD_LEVEL_DEBUG,
+                              "updated existing dynamic VLAN interface '%s'",
+                              iface);
        }
 
        /* ref counters have been increased, so mark the station */
index 7228ceedbd6c10b9f90751052e1aa3469275badb..e3df164e2083f163ad485acd8a8eb271ebf2ed5f 100644 (file)
@@ -173,7 +173,16 @@ static int ifconfig_up(const char *if_name)
 static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
                       int existsok)
 {
-       int ret;
+       int ret, i;
+
+       for (i = 0; i < NUM_WEP_KEYS; i++) {
+               if (!hapd->conf->ssid.wep.key[i])
+                       continue;
+               wpa_printf(MSG_ERROR,
+                          "VLAN: Refusing to set up VLAN iface %s with WEP",
+                          vlan->ifname);
+               return -1;
+       }
 
        if (!if_nametoindex(vlan->ifname))
                ret = hostapd_vlan_if_add(hapd, vlan->ifname);
@@ -937,32 +946,6 @@ static void full_dynamic_vlan_deinit(struct full_dynamic_vlan *priv)
 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
 
 
-int vlan_setup_encryption_dyn(struct hostapd_data *hapd, const char *dyn_vlan)
-{
-        int i;
-
-        if (dyn_vlan == NULL)
-               return 0;
-
-       /* Static WEP keys are set here; IEEE 802.1X and WPA uses their own
-        * functions for setting up dynamic broadcast keys. */
-       for (i = 0; i < 4; i++) {
-               if (hapd->conf->ssid.wep.key[i] &&
-                   hostapd_drv_set_key(dyn_vlan, hapd, WPA_ALG_WEP, NULL, i,
-                                       i == hapd->conf->ssid.wep.idx, NULL, 0,
-                                       hapd->conf->ssid.wep.key[i],
-                                       hapd->conf->ssid.wep.len[i]))
-               {
-                       wpa_printf(MSG_ERROR, "VLAN: Could not set WEP "
-                                  "encryption for dynamic VLAN");
-                       return -1;
-               }
-       }
-
-       return 0;
-}
-
-
 static int vlan_dynamic_add(struct hostapd_data *hapd,
                            struct hostapd_vlan *vlan)
 {
index fc39443e5d34b6592e19c6812f44bde47a4cce97..aeb2dc6f78c36f72e74b67ce7482e8b10cd8354d 100644 (file)
@@ -17,8 +17,6 @@ struct hostapd_vlan * vlan_add_dynamic(struct hostapd_data *hapd,
                                       struct hostapd_vlan *vlan,
                                       int vlan_id);
 int vlan_remove_dynamic(struct hostapd_data *hapd, int vlan_id);
-int vlan_setup_encryption_dyn(struct hostapd_data *hapd,
-                             const char *dyn_vlan);
 #else /* CONFIG_NO_VLAN */
 static inline int vlan_init(struct hostapd_data *hapd)
 {
@@ -40,12 +38,6 @@ static inline int vlan_remove_dynamic(struct hostapd_data *hapd, int vlan_id)
 {
        return -1;
 }
-
-static inline int vlan_setup_encryption_dyn(struct hostapd_data *hapd,
-                                           const char *dyn_vlan)
-{
-       return -1;
-}
 #endif /* CONFIG_NO_VLAN */
 
 #endif /* VLAN_INIT_H */