mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 10:18:21 -05:00
Remove unused send_eapol() driver op
The send_eapol() callback was used by driver_test.c, but with that removed, there is no remaining users of the alternative EAPOL frame transmitting mechanism in wpa_supplicant, i.e., all remaining driver interfaces use l2_packet instead. Remove the send_eapol() to get rid of unused code. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
5e80b502ee
commit
2961bfa8e1
@ -1725,27 +1725,6 @@ struct wpa_driver_ops {
|
||||
* a MAC address. */
|
||||
const u8 * (*get_mac_addr)(void *priv);
|
||||
|
||||
/**
|
||||
* send_eapol - Optional function for sending EAPOL packets
|
||||
* @priv: private driver interface data
|
||||
* @dest: Destination MAC address
|
||||
* @proto: Ethertype
|
||||
* @data: EAPOL packet starting with IEEE 802.1X header
|
||||
* @data_len: Size of the EAPOL packet
|
||||
*
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*
|
||||
* This optional function can be used to override l2_packet operations
|
||||
* with driver specific functionality. If this function pointer is set,
|
||||
* l2_packet module is not used at all and the driver interface code is
|
||||
* responsible for receiving and sending all EAPOL packets. The
|
||||
* received EAPOL packets are sent to core code with EVENT_EAPOL_RX
|
||||
* event. The driver interface is required to implement get_mac_addr()
|
||||
* handler if send_eapol() is used.
|
||||
*/
|
||||
int (*send_eapol)(void *priv, const u8 *dest, u16 proto,
|
||||
const u8 *data, size_t data_len);
|
||||
|
||||
/**
|
||||
* set_operstate - Sets device operating state to DORMANT or UP
|
||||
* @priv: private driver interface data
|
||||
@ -3477,9 +3456,7 @@ enum wpa_event_type {
|
||||
* EVENT_EAPOL_RX - Report received EAPOL frame
|
||||
*
|
||||
* When in AP mode with hostapd, this event is required to be used to
|
||||
* deliver the receive EAPOL frames from the driver. With
|
||||
* %wpa_supplicant, this event is used only if the send_eapol() handler
|
||||
* is used to override the use of l2_packet for EAPOL frame TX.
|
||||
* deliver the receive EAPOL frames from the driver.
|
||||
*/
|
||||
EVENT_EAPOL_RX,
|
||||
|
||||
|
@ -74,13 +74,6 @@ static void none_driver_deinit(void *priv)
|
||||
}
|
||||
|
||||
|
||||
static int none_driver_send_eapol(void *priv, const u8 *dest, u16 proto,
|
||||
const u8 *data, size_t data_len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
const struct wpa_driver_ops wpa_driver_none_ops = {
|
||||
.name = "none",
|
||||
.desc = "no driver (RADIUS server/WPS ER)",
|
||||
@ -89,5 +82,4 @@ const struct wpa_driver_ops wpa_driver_none_ops = {
|
||||
.send_ether = none_driver_send_ether,
|
||||
.init = none_driver_init,
|
||||
.deinit = none_driver_deinit,
|
||||
.send_eapol = none_driver_send_eapol,
|
||||
};
|
||||
|
@ -244,16 +244,6 @@ static inline const u8 * wpa_drv_get_mac_addr(struct wpa_supplicant *wpa_s)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int wpa_drv_send_eapol(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dst, u16 proto,
|
||||
const u8 *data, size_t data_len)
|
||||
{
|
||||
if (wpa_s->driver->send_eapol)
|
||||
return wpa_s->driver->send_eapol(wpa_s->drv_priv, dst, proto,
|
||||
data, data_len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int wpa_drv_set_operstate(struct wpa_supplicant *wpa_s,
|
||||
int state)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ static int supp_ether_send(void *ctx, const u8 *dest, u16 proto, const u8 *buf,
|
||||
if (wpa_s->l2)
|
||||
return l2_packet_send(wpa_s->l2, dest, proto, buf, len);
|
||||
|
||||
return wpa_drv_send_eapol(wpa_s, dest, proto, buf, len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -283,7 +283,7 @@ static int auth_send_eapol(void *ctx, const u8 *addr, const u8 *data,
|
||||
return l2_packet_send(wpa_s->l2, addr, ETH_P_EAPOL, data,
|
||||
data_len);
|
||||
|
||||
return wpa_drv_send_eapol(wpa_s, addr, ETH_P_EAPOL, data, data_len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2825,15 +2825,9 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
|
||||
|
||||
int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
if (wpa_s->driver->send_eapol) {
|
||||
const u8 *addr = wpa_drv_get_mac_addr(wpa_s);
|
||||
if (addr)
|
||||
os_memcpy(wpa_s->own_addr, addr, ETH_ALEN);
|
||||
} else if ((!wpa_s->p2p_mgmt ||
|
||||
!(wpa_s->drv_flags &
|
||||
WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)) &&
|
||||
!(wpa_s->drv_flags &
|
||||
WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE)) {
|
||||
if ((!wpa_s->p2p_mgmt ||
|
||||
!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)) &&
|
||||
!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE)) {
|
||||
l2_packet_deinit(wpa_s->l2);
|
||||
wpa_s->l2 = l2_packet_init(wpa_s->ifname,
|
||||
wpa_drv_get_mac_addr(wpa_s),
|
||||
|
@ -115,7 +115,7 @@ static int wpa_ether_send(struct wpa_supplicant *wpa_s, const u8 *dest,
|
||||
return l2_packet_send(wpa_s->l2, dest, proto, buf, len);
|
||||
}
|
||||
|
||||
return wpa_drv_send_eapol(wpa_s, dest, proto, buf, len);
|
||||
return -1;
|
||||
}
|
||||
#endif /* IEEE8021X_EAPOL || !CONFIG_NO_WPA */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user