Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 221641 Details for
Bug 313381
wpa_supplicant wakes up the cpu
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Lightly tested fix against 0.5.7
wpa_supplicant-poll.diff (text/plain), 4.35 KB, created by
Alan Jenkins
on 2007-10-09 18:38:57 UTC
(
hide
)
Description:
Lightly tested fix against 0.5.7
Filename:
MIME Type:
Creator:
Alan Jenkins
Created:
2007-10-09 18:38:57 UTC
Size:
4.35 KB
patch
obsolete
>diff --git a/ctrl_iface_dbus.c b/ctrl_iface_dbus.c >diff --git a/driver_wext.c b/driver_wext.c >diff --git a/eapol_sm.c b/eapol_sm.c >index 285bc5d..c1a9a66 100644 >--- a/eapol_sm.c >+++ b/eapol_sm.c >@@ -39,6 +39,7 @@ struct eapol_sm { > unsigned int heldWhile; > unsigned int startWhen; > unsigned int idleWhile; /* for EAP state machine */ >+ unsigned int nextTimer; > > /* Global variables */ > Boolean eapFail; >@@ -193,39 +194,63 @@ static void eapol_sm_txSuppRsp(struct eapol_sm *sm); > static void eapol_sm_abortSupp(struct eapol_sm *sm); > static void eapol_sm_abort_cached(struct eapol_sm *sm); > static void eapol_sm_step_timeout(void *eloop_ctx, void *timeout_ctx); >+static void eapol_port_timers_recalculate(void *eloop_ctx, struct eapol_sm *sm); > > >-/* Port Timers state machine - implemented as a function that will be called >- * once a second as a registered event loop timeout */ >-static void eapol_port_timers_tick(void *eloop_ctx, void *timeout_ctx) >+/* Port Timers state machine */ >+static void eapol_port_timers_next(void *eloop_ctx, void *timeout_ctx) > { > struct eapol_sm *sm = timeout_ctx; > > if (sm->authWhile > 0) { >- sm->authWhile--; >+ sm->authWhile -= sm->nextTimer; > if (sm->authWhile == 0) > wpa_printf(MSG_DEBUG, "EAPOL: authWhile --> 0"); > } > if (sm->heldWhile > 0) { >- sm->heldWhile--; >+ sm->heldWhile -= sm->nextTimer; > if (sm->heldWhile == 0) > wpa_printf(MSG_DEBUG, "EAPOL: heldWhile --> 0"); > } > if (sm->startWhen > 0) { >- sm->startWhen--; >+ sm->startWhen -= sm->nextTimer; > if (sm->startWhen == 0) > wpa_printf(MSG_DEBUG, "EAPOL: startWhen --> 0"); > } > if (sm->idleWhile > 0) { >- sm->idleWhile--; >+ sm->idleWhile -= sm->nextTimer; > if (sm->idleWhile == 0) > wpa_printf(MSG_DEBUG, "EAPOL: idleWhile --> 0"); > } > >- eloop_register_timeout(1, 0, eapol_port_timers_tick, eloop_ctx, sm); > eapol_sm_step(sm); >+ eapol_port_timers_recalculate(eloop_ctx, sm); > } > >+/* This function must be called after adjusting Port Timers, >+ * although state machine functions don't need to call it themselves; >+ * it happens automatically as part of the state machine execution */ >+static void eapol_port_timers_recalculate(void *eloop_ctx, struct eapol_sm *sm) >+{ >+ sm->nextTimer = (unsigned int) -1; >+ >+ if (sm->nextTimer > sm->authWhile) >+ sm->nextTimer = sm->authWhile; >+ >+ if (sm->nextTimer > sm->heldWhile) >+ sm->nextTimer = sm->heldWhile; >+ >+ if (sm->nextTimer > sm->startWhen) >+ sm->nextTimer = sm->startWhen; >+ >+ if (sm->nextTimer > sm->idleWhile) >+ sm->nextTimer = sm->idleWhile; >+ >+ eloop_register_timeout(sm->nextTimer, 0, eapol_port_timers_next, >+ eloop_ctx, sm); >+} >+ >+ > > SM_STATE(SUPP_PAE, LOGOFF) > { >@@ -853,13 +878,19 @@ void eapol_sm_step(struct eapol_sm *sm) > * However, it is better to use a limit on number of iterations to > * allow events (e.g., SIGTERM) to stop the program cleanly if the > * state machine were to generate a busy loop. */ >+ >+ sm->changed = FALSE; > for (i = 0; i < 100; i++) { >- sm->changed = FALSE; > SM_STEP_RUN(SUPP_PAE); > SM_STEP_RUN(KEY_RX); > SM_STEP_RUN(SUPP_BE); >- if (eap_sm_step(sm->eap)) >+ >+ if (eap_sm_step(sm->eap)) { > sm->changed = TRUE; >+ } else { >+ sm->changed = FALSE; >+ break; >+ } > } > > if (sm->changed) { >@@ -1432,6 +1463,7 @@ static void eapol_sm_abort_cached(struct eapol_sm *sm) > /* Make sure we do not start sending EAPOL-Start frames first, but > * instead move to RESTART state to start EAPOL authentication. */ > sm->startWhen = 3; >+ eapol_port_timers_recalculate(NULL, sm); > > if (sm->ctx->aborted_cached) > sm->ctx->aborted_cached(sm->ctx->ctx); >@@ -1650,6 +1682,7 @@ static void eapol_sm_set_int(void *ctx, enum eapol_int_var variable, > switch (variable) { > case EAPOL_idleWhile: > sm->idleWhile = value; >+ eapol_port_timers_recalculate(NULL, sm); > break; > } > } >@@ -1747,7 +1780,7 @@ struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx) > sm->initialize = FALSE; > eapol_sm_step(sm); > >- eloop_register_timeout(1, 0, eapol_port_timers_tick, NULL, sm); >+ eloop_register_timeout(1, 0, eapol_port_timers_next, NULL, sm); > > return sm; > } >@@ -1764,7 +1797,7 @@ void eapol_sm_deinit(struct eapol_sm *sm) > if (sm == NULL) > return; > eloop_cancel_timeout(eapol_sm_step_timeout, NULL, sm); >- eloop_cancel_timeout(eapol_port_timers_tick, NULL, sm); >+ eloop_cancel_timeout(eapol_port_timers_next, NULL, sm); > eap_sm_deinit(sm->eap); > free(sm->last_rx_key); > free(sm->eapReqData);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 313381
:
221641
|
221841