git: 864aa7e4a609 - stable/12 - lagg: don't update link layer addresses on destroy

Kristof Provost kp at FreeBSD.org
Thu Aug 26 12:06:34 UTC 2021


The branch stable/12 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=864aa7e4a6092e09d7155037262427a4ea57eb2b

commit 864aa7e4a6092e09d7155037262427a4ea57eb2b
Author:     Luiz Otavio O Souza <loos at FreeBSD.org>
AuthorDate: 2021-08-17 14:23:50 +0000
Commit:     Kristof Provost <kp at FreeBSD.org>
CommitDate: 2021-08-26 07:26:47 +0000

    lagg: don't update link layer addresses on destroy
    
    When the lagg is being destroyed it is not necessary update the
    lladdr of all the lagg members every time we update the primary
    interface.
    
    Reviewed by:    scottl
    Obtained from:  pfSense
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D31586
    
    (cherry picked from commit c138424148f900dc449c757869453120ae3277f3)
---
 sys/net/if_lagg.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 6831b40d099f..57c56604e65e 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -944,14 +944,16 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport)
 			bcopy(lladdr, IF_LLADDR(sc->sc_ifp), sc->sc_ifp->if_addrlen);
 			lagg_proto_lladdr(sc);
 			EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp);
-		}
 
-		/*
-		 * Update lladdr for each port (new primary needs update
-		 * as well, to switch from old lladdr to its 'real' one)
-		 */
-		CK_SLIST_FOREACH(lp_ptr, &sc->sc_ports, lp_entries)
-			if_setlladdr(lp_ptr->lp_ifp, lladdr, lp_ptr->lp_ifp->if_addrlen);
+			/*
+			 * Update lladdr for each port (new primary needs update
+			 * as well, to switch from old lladdr to its 'real' one).
+			 * We can skip this if the lagg is being destroyed.
+			 */
+			CK_SLIST_FOREACH(lp_ptr, &sc->sc_ports, lp_entries)
+				if_setlladdr(lp_ptr->lp_ifp, lladdr,
+				    lp_ptr->lp_ifp->if_addrlen);
+		}
 	}
 
 	if (lp->lp_ifflags)


More information about the dev-commits-src-branches mailing list