Untimeout before calling timeout. I think that I have caught all the cases
where we were scheduling a timeout multiple times, but am not positive.
This commit is contained in:
parent
a295ccc9f0
commit
8ad896e0ad
@ -61,7 +61,9 @@
|
|||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
#if __FreeBSD_version >= 500033
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
|
#endif
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#include <sys/mbuf.h>
|
#include <sys/mbuf.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
|
@ -40,7 +40,9 @@
|
|||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
#if __FreeBSD_version >= 500033
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
|
#endif
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#include <sys/mbuf.h>
|
#include <sys/mbuf.h>
|
||||||
#include <sys/malloc.h>
|
#include <sys/malloc.h>
|
||||||
@ -429,7 +431,6 @@ wihap_sta_alloc(struct wi_softc *sc, u_int8_t *addr)
|
|||||||
sta->sc = sc;
|
sta->sc = sc;
|
||||||
whi->n_stations++;
|
whi->n_stations++;
|
||||||
bcopy(addr, &sta->addr, ETHER_ADDR_LEN);
|
bcopy(addr, &sta->addr, ETHER_ADDR_LEN);
|
||||||
sta->inactivity_timer = whi->inactivity_time;
|
|
||||||
|
|
||||||
return(sta);
|
return(sta);
|
||||||
}
|
}
|
||||||
@ -553,7 +554,6 @@ wihap_auth_req(struct wi_softc *sc, struct wi_frame *rxfrm,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sta->inactivity_timer = whi->inactivity_time;
|
|
||||||
|
|
||||||
/* Note: it's okay to leave the station info structure around
|
/* Note: it's okay to leave the station info structure around
|
||||||
* if the authen fails. It'll be timed out eventually.
|
* if the authen fails. It'll be timed out eventually.
|
||||||
@ -987,7 +987,7 @@ wihap_sta_is_assoc(struct wihap_info *whi, u_int8_t addr[])
|
|||||||
sta = wihap_sta_find(whi, addr);
|
sta = wihap_sta_find(whi, addr);
|
||||||
if (sta != NULL && (sta->flags & WI_SIFLAGS_ASSOC)) {
|
if (sta != NULL && (sta->flags & WI_SIFLAGS_ASSOC)) {
|
||||||
/* Keep it active. */
|
/* Keep it active. */
|
||||||
sta->inactivity_timer = whi->inactivity_time;
|
untimeout(wihap_sta_timeout, sta, sta->tmo);
|
||||||
sta->tmo = timeout(wihap_sta_timeout, sta,
|
sta->tmo = timeout(wihap_sta_timeout, sta,
|
||||||
hz * whi->inactivity_time);
|
hz * whi->inactivity_time);
|
||||||
return(1);
|
return(1);
|
||||||
@ -1016,6 +1016,7 @@ wihap_check_tx(struct wihap_info *whi, u_int8_t addr[], u_int8_t *txrate)
|
|||||||
sta = wihap_sta_find(whi, addr);
|
sta = wihap_sta_find(whi, addr);
|
||||||
if (sta != NULL && (sta->flags & WI_SIFLAGS_ASSOC)) {
|
if (sta != NULL && (sta->flags & WI_SIFLAGS_ASSOC)) {
|
||||||
/* Keep it active. */
|
/* Keep it active. */
|
||||||
|
untimeout(wihap_sta_timeout, sta, sta->tmo);
|
||||||
sta->tmo = timeout(wihap_sta_timeout, sta,
|
sta->tmo = timeout(wihap_sta_timeout, sta,
|
||||||
hz * whi->inactivity_time);
|
hz * whi->inactivity_time);
|
||||||
*txrate = txratetable[ sta->tx_curr_rate ];
|
*txrate = txratetable[ sta->tx_curr_rate ];
|
||||||
@ -1078,6 +1079,7 @@ wihap_data_input(struct wi_softc *sc, struct wi_frame *rxfrm, struct mbuf *m)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
untimeout(wihap_sta_timeout, sta, sta->tmo);
|
||||||
sta->tmo = timeout(wihap_sta_timeout, sta,
|
sta->tmo = timeout(wihap_sta_timeout, sta,
|
||||||
hz * whi->inactivity_time);
|
hz * whi->inactivity_time);
|
||||||
sta->sig_info = le16toh(rxfrm->wi_q_info);
|
sta->sig_info = le16toh(rxfrm->wi_q_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user