aboutsummaryrefslogtreecommitdiff
path: root/src/net/eapol.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eapol.c')
-rw-r--r--src/net/eapol.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net/eapol.c b/src/net/eapol.c
index ce7be55..8b09ca2 100644
--- a/src/net/eapol.c
+++ b/src/net/eapol.c
@@ -167,6 +167,7 @@ static int eapol_eap_rx ( struct eapol_supplicant *supplicant,
/* Delay EAPoL-Start until after next expected packet */
DBGC ( netdev, "EAPOL %s deferring Start\n", netdev->name );
start_timer_fixed ( &supplicant->timer, EAP_WAIT_TIMEOUT );
+ supplicant->count = 0;
}
drop:
@@ -250,6 +251,12 @@ static void eapol_expired ( struct retry_timer *timer, int fail __unused ) {
container_of ( timer, struct eapol_supplicant, timer );
struct net_device *netdev = supplicant->eap.netdev;
+ /* Stop transmitting after maximum number of attempts */
+ if ( supplicant->count++ >= EAPOL_START_COUNT ) {
+ DBGC ( netdev, "EAPOL %s giving up\n", netdev->name );
+ return;
+ }
+
/* Schedule next transmission */
start_timer_fixed ( timer, EAPOL_START_INTERVAL );
@@ -317,6 +324,7 @@ static void eapol_notify ( struct net_device *netdev, void *priv ) {
/* Otherwise, start sending EAPoL-Start */
start_timer_nodelay ( &supplicant->timer );
+ supplicant->count = 0;
DBGC ( netdev, "EAPOL %s starting up\n", netdev->name );
}