git: df8824452d84 - stable/13 - lagg: don't update link layer addresses on destroy
Kristof Provost
kp at FreeBSD.org
Thu Aug 26 12:06:33 UTC 2021
The branch stable/13 has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=df8824452d841826de1dafe9f83e3a2631b3d9c8
commit df8824452d841826de1dafe9f83e3a2631b3d9c8
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 12:05:27 +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 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)
More information about the dev-commits-src-all
mailing list