summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-07-18 07:51:48 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-07-18 07:51:48 +0000
commitcccc5e02337a16633680fa2c9cab02aa633707ec (patch)
tree882674f6967a8c0a3d576bf9d0b789b6ca4b1622 /sys
parent7ea20dd490695d024435e12923aff50212d667e0 (diff)
run the selection logic from the rxm current state if the port is unselected
previously it would only run the selection logic if the peer information changed, but it is possible to be in the current state with stale partner info. that can happen if the port becomes disabled/disconnected, which unwinds the mux machine, but doesnt clear the partner info. when the link is enabled again we re-enter the current state, but because the partner info is the same we didn't run the selection logic, which in turn didn't let the mux machine move forward again.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_aggr.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/net/if_aggr.c b/sys/net/if_aggr.c
index 8a07cbb5b3e..41e0e970542 100644
--- a/sys/net/if_aggr.c
+++ b/sys/net/if_aggr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_aggr.c,v 1.11 2019/07/18 06:14:16 dlg Exp $ */
+/* $OpenBSD: if_aggr.c,v 1.12 2019/07/18 07:51:47 dlg Exp $ */
/*
* Copyright (c) 2019 The University of Queensland
@@ -1504,7 +1504,7 @@ aggr_input_lacpdu(struct aggr_port *p, struct mbuf *m)
m_freem(m);
}
-static int
+static void
aggr_update_selected(struct aggr_softc *sc, struct aggr_port *p,
const struct lacp_du *lacpdu)
{
@@ -1522,10 +1522,9 @@ aggr_update_selected(struct aggr_softc *sc, struct aggr_port *p,
(rpi->lacp_key == lpi->lacp_key) &&
(ISSET(rpi->lacp_state, LACP_STATE_AGGREGATION) ==
ISSET(lpi->lacp_state, LACP_STATE_AGGREGATION)))
- return (0);
+ return;
aggr_unselected(p);
- return (1);
}
static void
@@ -1783,8 +1782,6 @@ aggr_selection_logic(struct aggr_softc *sc, struct aggr_port *p)
}
aggr_selected(p);
- DPRINTF(sc, "%s %s: selection logic: selected\n",
- ifp->if_xname, p->p_ifp0->if_xname);
return;
unselected:
@@ -2276,16 +2273,16 @@ aggr_rxm_ev(struct aggr_softc *sc, struct aggr_port *p,
* Actor_Oper_Port_State.LACP_Timeout);
* Actor_Oper_Port_State.Expired = FALSE;
*/
- int sync, unselected;
+ int sync;
- unselected = aggr_update_selected(sc, p, lacpdu);
+ aggr_update_selected(sc, p, lacpdu);
sync = aggr_update_ntt(p, lacpdu);
/* don't support v2 yet */
aggr_recordpdu(p, lacpdu, sync);
aggr_start_current_while_timer(p, sc->sc_lacp_timeout);
CLR(p->p_actor_state, LACP_STATE_EXPIRED);
- if (unselected)
+ if (p->p_selected == AGGR_PORT_UNSELECTED)
aggr_selection_logic(sc, p); /* restart */
}