From 4ccbf5197613b903e39e84849eec12f1d0e7c529 Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Mon, 12 Oct 2026 16:27:22 +0200 Subject: [PATCH] lacp: ignore a LACPDU that carries our own system id Two ports of one group cabled to each other heard themselves and the group aggregated with itself. Sandbox T24. --- rtl837x_lacp.c | 2 ++ test/lacp/lacp_sim.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/rtl837x_lacp.c b/rtl837x_lacp.c index 4f0fa44d..e2ede9e3 100644 --- a/rtl837x_lacp.c +++ b/rtl837x_lacp.c @@ -292,6 +292,8 @@ void lacp_in(void) __banked uint8_t lag = lacp_port_lag[port]; if (lag == LACP_LAG_NONE) return; + if (lacp_sys_eq(LACP_I->actor.sys, uip_ethaddr.addr)) + return; #ifdef DEBUG diff --git a/test/lacp/lacp_sim.c b/test/lacp/lacp_sim.c index 7efa67c6..13d571cd 100644 --- a/test/lacp/lacp_sim.c +++ b/test/lacp/lacp_sim.c @@ -475,6 +475,15 @@ int main(int argc, char **argv) "T23 partner on slow rate goes quiet: dropped after our short timeout"); lacp_lag_set(1, 0); + /* T24: a LACPDU carrying our own system id (two ports of one group + * cabled to each other) must not be taken for a partner. */ + lacp_lag_set(1, 0x0030); + step(8); + partner_frame(4, uip_ethaddr.addr, P_ACT|P_AGG|P_TO|P_SYNC, 1); + CHECK(lacp_rx_count[4] == 0 && lacp_rx_state[4] == LACP_RX_INITIALIZE, + "T24 own system id: LACPDU ignored"); + lacp_lag_set(1, 0); + printf("\n%s (%d failure%s)\n", failures ? "SANDBOX: FAILURES" : "SANDBOX: ALL PASS", failures, failures == 1 ? "" : "s"); return failures ? 1 : 0;