Patchwork Cancel previous registered wps_registrar_pbc_timeout.

login
register
mail settings
Submitter jungwalk@gmail.com
Date Dec. 28, 2011, 7:30 a.m.
Message ID <1325057444-3765-1-git-send-email-jungwalk@gmail.com>
Download mbox | patch
Permalink /patch/133414/
State Accepted
Commit 62a8ea7d01428ed717eb36b32020ce9a89fb59ae
Headers show

Comments

jungwalk@gmail.com - Dec. 28, 2011, 7:30 a.m.
From: Spencer Chang <jungwalk@gmail.com>

Since wps_registrar_pbc_timeout is called to stop PBC, then previous
registered wps_registrar_pbc_timeout should be cancelled in case it is
called again.

Signed-off-by: Spencer Chang <jungwalk@gmail.com>
---
 src/wps/wps_registrar.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Jouni Malinen - Dec. 29, 2011, 7:35 p.m.
On Wed, Dec 28, 2011 at 03:30:44PM +0800, jungwalk@gmail.com wrote:
> Since wps_registrar_pbc_timeout is called to stop PBC, then previous
> registered wps_registrar_pbc_timeout should be cancelled in case it is
> called again.

Thanks, applied.

Patch

diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
index eda1c70..e5e8d28 100644
--- a/src/wps/wps_registrar.c
+++ b/src/wps/wps_registrar.c
@@ -962,6 +962,7 @@  int wps_registrar_wps_cancel(struct wps_registrar *reg)
 	if (reg->pbc) {
 		wpa_printf(MSG_DEBUG, "WPS: PBC is set - cancelling it");
 		wps_registrar_pbc_timeout(reg, NULL);
+		eloop_cancel_timeout(wps_registrar_pbc_timeout, reg, NULL);
 		return 1;
 	} else if (reg->selected_registrar) {
 		/* PIN Method */