Browse Source

Moved association check from driver_*.c into ieee802_1x_receive()

Jouni Malinen 16 years ago
parent
commit
940a0ce970
3 changed files with 3 additions and 18 deletions
  1. 0 8
      hostapd/driver_bsd.c
  2. 0 8
      hostapd/driver_madwifi.c
  3. 3 2
      hostapd/ieee802_1x.c

+ 0 - 8
hostapd/driver_bsd.c

@@ -697,15 +697,7 @@ handle_read(void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
 {
 	struct bsd_driver_data *drv = ctx;
 	struct hostapd_data *hapd = drv->hapd;
-	struct sta_info *sta;
 
-	sta = ap_get_sta(hapd, src_addr);
-	if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
-		printf("Data frame from not associated STA %s\n",
-		       ether_sprintf(src_addr));
-		/* XXX cannot happen */
-		return;
-	}
 	ieee802_1x_receive(hapd, src_addr, buf + sizeof(struct l2_ethhdr),
 			   len - sizeof(struct l2_ethhdr));
 }

+ 0 - 8
hostapd/driver_madwifi.c

@@ -1241,15 +1241,7 @@ handle_read(void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
 {
 	struct madwifi_driver_data *drv = ctx;
 	struct hostapd_data *hapd = drv->hapd;
-	struct sta_info *sta;
 
-	sta = ap_get_sta(hapd, src_addr);
-	if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
-		printf("Data frame from not associated STA %s\n",
-		       ether_sprintf(src_addr));
-		/* XXX cannot happen */
-		return;
-	}
 	ieee802_1x_receive(hapd, src_addr, buf + sizeof(struct l2_ethhdr),
 			   len - sizeof(struct l2_ethhdr));
 }

+ 3 - 2
hostapd/ieee802_1x.c

@@ -674,8 +674,9 @@ void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
 	wpa_printf(MSG_DEBUG, "IEEE 802.1X: %lu bytes from " MACSTR,
 		   (unsigned long) len, MAC2STR(sa));
 	sta = ap_get_sta(hapd, sa);
-	if (!sta) {
-		printf("   no station information available\n");
+	if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
+		wpa_printf(MSG_DEBUG, "IEEE 802.1X data frame from not "
+			   "associated STA");
 		return;
 	}