Remove struct ieee80211_hdr dependency from EVENT_RX_FROM_UNKNOWN

It is simpler to just pass in u8* to the beginning of the header.
This commit is contained in:
Jouni Malinen 2010-01-03 12:17:20 +02:00
parent a0e0d3bb15
commit 0d9fc3d8bd
4 changed files with 9 additions and 11 deletions

View File

@ -256,9 +256,9 @@ static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
static void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd, static void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd,
const struct ieee80211_hdr *hdr, const u8 *frame, size_t len)
size_t len)
{ {
const struct ieee80211_hdr *hdr = (const struct ieee80211_hdr *) frame;
u16 fc = le_to_host16(hdr->frame_control); u16 fc = le_to_host16(hdr->frame_control);
hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len)); hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
if (hapd == NULL || hapd == HAPD_BROADCAST) if (hapd == NULL || hapd == HAPD_BROADCAST)
@ -378,7 +378,7 @@ void wpa_supplicant_event(void *ctx, wpa_event_type event,
} }
break; break;
case EVENT_RX_FROM_UNKNOWN: case EVENT_RX_FROM_UNKNOWN:
hostapd_rx_from_unknown_sta(hapd, data->rx_from_unknown.hdr, hostapd_rx_from_unknown_sta(hapd, data->rx_from_unknown.frame,
data->rx_from_unknown.len); data->rx_from_unknown.len);
break; break;
case EVENT_RX_MGMT: case EVENT_RX_MGMT:

View File

@ -1947,7 +1947,7 @@ union wpa_event_data {
* struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
*/ */
struct rx_from_unknown { struct rx_from_unknown {
const struct ieee80211_hdr *hdr; const u8 *frame;
size_t len; size_t len;
} rx_from_unknown; } rx_from_unknown;
@ -2050,8 +2050,6 @@ void wpa_scan_sort_results(struct wpa_scan_results *res);
/* hostapd functions for driver wrappers */ /* hostapd functions for driver wrappers */
struct ieee80211_hdr;
int hostapd_notif_new_sta(struct hostapd_data *hapd, const u8 *addr); int hostapd_notif_new_sta(struct hostapd_data *hapd, const u8 *addr);
int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
const u8 *ie, size_t ielen); const u8 *ie, size_t ielen);

View File

@ -83,7 +83,7 @@ static void handle_data(struct hostap_driver_data *drv, u8 *buf, size_t len,
sa = hdr->addr2; sa = hdr->addr2;
os_memset(&event, 0, sizeof(event)); os_memset(&event, 0, sizeof(event));
event.rx_from_unknown.hdr = hdr; event.rx_from_unknown.frame = buf;
event.rx_from_unknown.len = len; event.rx_from_unknown.len = len;
wpa_supplicant_event(drv->hapd, EVENT_RX_FROM_UNKNOWN, &event); wpa_supplicant_event(drv->hapd, EVENT_RX_FROM_UNKNOWN, &event);

View File

@ -2715,11 +2715,11 @@ static void handle_tx_callback(void *ctx, u8 *buf, size_t len, int ok)
static void from_unknown_sta(struct wpa_driver_nl80211_data *drv, static void from_unknown_sta(struct wpa_driver_nl80211_data *drv,
struct ieee80211_hdr *hdr, size_t len) u8 *buf, size_t len)
{ {
union wpa_event_data event; union wpa_event_data event;
os_memset(&event, 0, sizeof(event)); os_memset(&event, 0, sizeof(event));
event.rx_from_unknown.hdr = hdr; event.rx_from_unknown.frame = buf;
event.rx_from_unknown.len = len; event.rx_from_unknown.len = len;
wpa_supplicant_event(drv->ctx, EVENT_RX_FROM_UNKNOWN, &event); wpa_supplicant_event(drv->ctx, EVENT_RX_FROM_UNKNOWN, &event);
} }
@ -2747,10 +2747,10 @@ static void handle_frame(struct wpa_driver_nl80211_data *drv,
case WLAN_FC_TYPE_CTRL: case WLAN_FC_TYPE_CTRL:
/* can only get here with PS-Poll frames */ /* can only get here with PS-Poll frames */
wpa_printf(MSG_DEBUG, "CTRL"); wpa_printf(MSG_DEBUG, "CTRL");
from_unknown_sta(drv, hdr, len); from_unknown_sta(drv, buf, len);
break; break;
case WLAN_FC_TYPE_DATA: case WLAN_FC_TYPE_DATA:
from_unknown_sta(drv, hdr, len); from_unknown_sta(drv, buf, len);
break; break;
} }
} }