]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[lacp] Detect and ignore erroneously looped back LACP packets
authorMichael Brown <mcb30@ipxe.org>
Tue, 13 Oct 2020 12:35:39 +0000 (13:35 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 14 Oct 2020 12:36:17 +0000 (13:36 +0100)
Some external drivers (observed with the UEFI NII driver provided by
an HPE-branded Mellanox ConnectX-3 Pro) seem to cause LACP packets
transmitted by iPXE to be looped back as received packets.  Since
iPXE's trivial LACP responder will send one response per received
packet, this results in an immediate LACP packet storm.

Detect looped back LACP packets (based on the received LACP actor MAC
address), and refuse to respond to such packets.

Reported-by: Tore Anderson <tore@fud.no>
Tested-by: Tore Anderson <tore@fud.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/eth_slow.c

index baa51dbc17176d143550c53da92585841e054f3b..fa7a6e361100c12d7254eff7ba4d07a8ca951904 100644 (file)
@@ -153,6 +153,14 @@ static int eth_slow_lacp_rx ( struct io_buffer *iobuf,
 
        eth_slow_lacp_dump ( iobuf, netdev, "RX" );
 
+       /* Check for looped-back packets */
+       if ( memcmp ( lacp->actor.system, netdev->ll_addr,
+                     sizeof ( lacp->actor.system ) ) == 0 ) {
+               DBGC ( netdev, "SLOW %s RX loopback detected\n",
+                      netdev->name );
+               return -ELOOP;
+       }
+
        /* If partner is not in sync, collecting, and distributing,
         * then block the link until after the next expected LACP
         * packet.