Page MenuHomeFreeBSD

D35070.diff
No OneTemporary

D35070.diff

diff --git a/sys/net/ieee8023ad_lacp.h b/sys/net/ieee8023ad_lacp.h
--- a/sys/net/ieee8023ad_lacp.h
+++ b/sys/net/ieee8023ad_lacp.h
@@ -222,6 +222,7 @@
#define lp_key lp_actor.lip_key
#define lp_systemid lp_actor.lip_systemid
struct timeval lp_last_lacpdu;
+ struct timeval lp_last_lacpdu_rx;
int lp_lacpdu_sent;
enum lacp_mux_state lp_mux_state;
enum lacp_selected lp_selected;
diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -49,6 +49,7 @@
#include <sys/lock.h>
#include <sys/rwlock.h>
#include <sys/taskqueue.h>
+#include <sys/time.h>
#include <net/if.h>
#include <net/if_var.h>
@@ -1731,6 +1732,7 @@
* EXPIRED, DEFAULTED, CURRENT -> CURRENT
*/
+ microuptime(&lp->lp_last_lacpdu_rx);
lacp_sm_rx_update_selected(lp, du);
lacp_sm_rx_update_ntt(lp, du);
lacp_sm_rx_record_pdu(lp, du);
@@ -1940,14 +1942,26 @@
lacp_run_timers(struct lacp_port *lp)
{
int i;
+ struct timeval time_diff;
for (i = 0; i < LACP_NTIMER; i++) {
KASSERT(lp->lp_timer[i] >= 0,
("invalid timer value %d", lp->lp_timer[i]));
if (lp->lp_timer[i] == 0) {
continue;
- } else if (--lp->lp_timer[i] <= 0) {
- if (lacp_timer_funcs[i]) {
+ } else {
+ if (i == LACP_TIMER_CURRENT_WHILE) {
+ microuptime(&time_diff);
+ timevalsub(&time_diff, &lp->lp_last_lacpdu_rx);
+ if (time_diff.tv_sec) {
+ /* At least one sec has elapsed since last LACP packet. */
+ --lp->lp_timer[i];
+ }
+ } else {
+ --lp->lp_timer[i];
+ }
+
+ if ((lp->lp_timer[i] <= 0) && (lacp_timer_funcs[i])) {
(*lacp_timer_funcs[i])(lp);
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 15, 6:36 PM (22 h, 56 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15416173
Default Alt Text
D35070.diff (1 KB)

Event Timeline