From 08032c7418ebf25f773907750397639b8b0330fb Mon Sep 17 00:00:00 2001 From: Sam Tannous Date: Mon, 17 Oct 2016 18:02:16 -0400 Subject: [PATCH] Remove inactivity timeout for wired interfaces We should unconditionally remove inactivity timers for wired network cases. This commit checks for this after a new station association: hapd->iface->drv_flags & WPA_DRIVER_FLAGS_WIRED and then cancels the timeout and does not register a new one. It prints out a debug message like this: 1476740180.276286: IEEE 802.1X: 00:02:00:00:00:07 CTRL_DIR entering state FORCE_BOTH 1476740180.276295: hostapd_new_assoc_sta: canceled wired ap_handle_timer timeout for 00:02:00:00:00:07 This was tested on a debian jessie amd64 system with a configured 120 second inactivity timer and the session did not timeout. Signed-off-by: Sam Tannous --- src/ap/hostapd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 21a540858..7c4037906 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -2832,7 +2832,16 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, } else wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm); - if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) { + if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_WIRED) { + if (eloop_cancel_timeout(ap_handle_timer, hapd, sta) > 0) { + wpa_printf(MSG_DEBUG, + "%s: %s: canceled wired ap_handle_timer timeout for " + MACSTR, + hapd->conf->iface, __func__, + MAC2STR(sta->addr)); + } + } else if (!(hapd->iface->drv_flags & + WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) { wpa_printf(MSG_DEBUG, "%s: %s: reschedule ap_handle_timer timeout for " MACSTR " (%d seconds - ap_max_inactivity)",