[PATCH 02/12] mesh: Cancel previous dot11MeshConfirmTimeout before registering

Masashi Honma masashi.honma at gmail.com
Tue Nov 4 00:36:43 EST 2014


Signed-off-by: Kazuyuki Sakoda <KazuyukiA.Sakoda at jp.sony.com>
Signed-off-by: Masashi Honma <masashi.honma at gmail.com>
---
 wpa_supplicant/mesh_mpm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index 322c96c..4a11d88 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -633,6 +633,7 @@ static void mesh_mpm_fsm(struct wpa_supplicant *wpa_s, struct sta_info *sta,
 	struct hostapd_data *hapd = wpa_s->ifmsh->bss[0];
 	struct mesh_conf *conf = wpa_s->ifmsh->mconf;
 	u16 reason = 0;
+	struct os_reltime remaining;
 
 	wpa_msg(wpa_s, MSG_DEBUG, "MPM " MACSTR " state %s event %s",
 		MAC2STR(sta->addr), mplstate[sta->plink_state],
@@ -663,6 +664,8 @@ static void mesh_mpm_fsm(struct wpa_supplicant *wpa_s, struct sta_info *sta,
 			wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
 			if (!reason)
 				reason = WLAN_REASON_MESH_CLOSE_RCVD;
+			eloop_cancel_timeout_one(plink_timer, wpa_s, sta,
+						 &remaining);
 			eloop_register_timeout(dot11MeshHoldingTimeout, 0,
 					       plink_timer, wpa_s, sta);
 			mesh_mpm_send_plink_action(wpa_s, sta,
@@ -676,6 +679,8 @@ static void mesh_mpm_fsm(struct wpa_supplicant *wpa_s, struct sta_info *sta,
 			break;
 		case CNF_ACPT:
 			wpa_mesh_set_plink_state(wpa_s, sta, PLINK_CNF_RCVD);
+			eloop_cancel_timeout_one(plink_timer, wpa_s, sta,
+						 &remaining);
 			eloop_register_timeout(dot11MeshConfirmTimeout, 0,
 					       plink_timer, wpa_s, sta);
 			break;
@@ -693,6 +698,8 @@ static void mesh_mpm_fsm(struct wpa_supplicant *wpa_s, struct sta_info *sta,
 			wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
 			if (!reason)
 				reason = WLAN_REASON_MESH_CLOSE_RCVD;
+			eloop_cancel_timeout_one(plink_timer, wpa_s, sta,
+						 &remaining);
 			eloop_register_timeout(dot11MeshHoldingTimeout, 0,
 					       plink_timer, wpa_s, sta);
 			sta->mpm_close_reason = reason;
@@ -722,6 +729,8 @@ static void mesh_mpm_fsm(struct wpa_supplicant *wpa_s, struct sta_info *sta,
 			wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
 			if (!reason)
 				reason = WLAN_REASON_MESH_CLOSE_RCVD;
+			eloop_cancel_timeout_one(plink_timer, wpa_s, sta,
+						 &remaining);
 			eloop_register_timeout(dot11MeshHoldingTimeout, 0,
 					       plink_timer, wpa_s, sta);
 			sta->mpm_close_reason = reason;
@@ -743,6 +752,8 @@ static void mesh_mpm_fsm(struct wpa_supplicant *wpa_s, struct sta_info *sta,
 			wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
 			reason = WLAN_REASON_MESH_CLOSE_RCVD;
 
+			eloop_cancel_timeout_one(plink_timer, wpa_s, sta,
+						 &remaining);
 			eloop_register_timeout(dot11MeshHoldingTimeout, 0,
 					       plink_timer, wpa_s, sta);
 			sta->mpm_close_reason = reason;
-- 
1.9.1



More information about the HostAP mailing list