]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove inactivity timeout for wired interfaces
authorSam Tannous <stannous@cumulusnetworks.com>
Mon, 17 Oct 2016 22:02:16 +0000 (18:02 -0400)
committerJouni Malinen <j@w1.fi>
Sun, 4 Dec 2016 18:38:45 +0000 (20:38 +0200)
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 <stannous@cumulusnetworks.com>
src/ap/hostapd.c

index 21a5408584e1b398b9064ec68803ee4fc6625ec4..7c40379065436ee8621726c629a3badd25547dd6 100644 (file)
@@ -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)",