The branch main has been updated by kp:

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

commit c138424148f900dc449c757869453120ae3277f3
Author:     Luiz Otavio O Souza <[email protected]>
AuthorDate: 2021-08-17 14:23:50 +0000
Commit:     Kristof Provost <[email protected]>
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)
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "[email protected]"

Reply via email to