int reassoc);
void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr,
const u8 *buf, size_t len, int ack);
+void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd, const u8 *addr);
#endif /* DRIVER_H */
#include "eloop.h"
#include "priv_netlink.h"
#include "ieee802_11.h"
-#include "sta_info.h"
#include "hostap_common.h"
#include "hw_features.h"
u16 fc, ethertype;
u8 *pos, *sa;
size_t left;
- struct sta_info *sta;
if (len < sizeof(struct ieee80211_hdr))
return;
}
sa = hdr->addr2;
- sta = ap_get_sta(drv->hapd, sa);
- if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
- printf("Data frame from not associated STA " MACSTR "\n",
- MAC2STR(sa));
- if (sta && (sta->flags & WLAN_STA_AUTH))
- hostap_sta_disassoc(
- drv, sa,
- WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
- else
- hostap_sta_deauth(
- drv, sa,
- WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
- return;
- }
+ hostapd_rx_from_unknown_sta(drv->hapd, sa);
pos = (u8 *) (hdr + 1);
left = len - sizeof(*hdr);
#include "ieee802_1x.h"
#include "eloop.h"
#include "ieee802_11.h"
-#include "sta_info.h"
#include "hw_features.h"
#include "mlme.h"
#include "radiotap.h"
}
-static void handle_unknown_sta(struct i802_driver_data *drv, u8 *ta)
-{
- struct sta_info *sta;
-
- sta = ap_get_sta(drv->hapd, ta);
- if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
- printf("Data/PS-poll frame from not associated STA "
- MACSTR "\n", MAC2STR(ta));
- if (sta && (sta->flags & WLAN_STA_AUTH))
- i802_sta_disassoc(
- drv, ta,
- WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
- else
- i802_sta_deauth(
- drv, ta,
- WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
- }
-}
-
-
static void handle_tx_callback(struct hostapd_data *hapd, u8 *buf, size_t len,
int ok)
{
case WLAN_FC_TYPE_CTRL:
/* can only get here with PS-Poll frames */
wpa_printf(MSG_DEBUG, "CTRL");
- handle_unknown_sta(drv, hdr->addr2);
+ hostapd_rx_from_unknown_sta(drv->hapd, hdr->addr2);
break;
case WLAN_FC_TYPE_DATA:
- handle_unknown_sta(drv, hdr->addr2);
+ hostapd_rx_from_unknown_sta(drv->hapd, hdr->addr2);
break;
}
}
}
+void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd, const u8 *addr)
+{
+ struct sta_info *sta;
+
+ sta = ap_get_sta(hapd, addr);
+ if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
+ wpa_printf(MSG_DEBUG, "Data/PS-poll frame from not associated "
+ "STA " MACSTR, MAC2STR(addr));
+ if (sta && (sta->flags & WLAN_STA_AUTH))
+ hostapd_sta_disassoc(
+ hapd, addr,
+ WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
+ else
+ hostapd_sta_deauth(
+ hapd, addr,
+ WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
+ }
+}
+
+
#ifdef EAP_SERVER
static int hostapd_sim_db_cb_sta(struct hostapd_data *hapd,
struct sta_info *sta, void *ctx)