Date: Thu, 19 Aug 2021 09:46:45 GMT From: Kristof Provost <kp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: c138424148f9 - main - lagg: don't update link layer addresses on destroy Message-ID: <202108190946.17J9kjuh002615@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c138424148f900dc449c757869453120ae3277f3 commit c138424148f900dc449c757869453120ae3277f3 Author: Luiz Otavio O Souza <loos@FreeBSD.org> AuthorDate: 2021-08-17 14:23:50 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-08-19 08:49:32 +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 --- 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 9a3c22789fa5..c53e5b283b76 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -969,14 +969,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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108190946.17J9kjuh002615>