struct eap_supplicant eap;
/** EAPoL-Start retransmission timer */
struct retry_timer timer;
+ /** EAPoL-Start transmission count */
+ unsigned int count;
};
/** Delay between EAPoL-Start packets */
#define EAPOL_START_INTERVAL ( 2 * TICKS_PER_SEC )
+/** Maximum number of EAPoL-Start packets to transmit */
+#define EAPOL_START_COUNT 3
+
/** An EAPoL handler */
struct eapol_handler {
/** Type */
/* 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:
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 );
/* Otherwise, start sending EAPoL-Start */
start_timer_nodelay ( &supplicant->timer );
+ supplicant->count = 0;
DBGC ( netdev, "EAPOL %s starting up\n", netdev->name );
}