Module Name: src
Committed By: yamaguchi
Date: Wed Oct 18 06:37:08 UTC 2023
Modified Files:
src/sys/net/lagg: if_lagg.c
Log Message:
copy MTU of lagg to a interface added to lagg
even if the interface is the first member of the lagg
This change breaks ATF test case for lagg MTU
To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/net/lagg/if_lagg.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/lagg/if_lagg.c
diff -u src/sys/net/lagg/if_lagg.c:1.50 src/sys/net/lagg/if_lagg.c:1.51
--- src/sys/net/lagg/if_lagg.c:1.50 Mon Oct 16 08:25:57 2023
+++ src/sys/net/lagg/if_lagg.c Wed Oct 18 06:37:08 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: if_lagg.c,v 1.50 2023/10/16 08:25:57 yamaguchi Exp $ */
+/* $NetBSD: if_lagg.c,v 1.51 2023/10/18 06:37:08 yamaguchi Exp $ */
/*
* Copyright (c) 2005, 2006 Reyk Floeter <[email protected]>
@@ -20,7 +20,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.50 2023/10/16 08:25:57 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.51 2023/10/18 06:37:08 yamaguchi Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -2243,11 +2243,12 @@ lagg_port_setup(struct lagg_softc *sc,
lagg_port_setsadl(lp, NULL);
} else {
lagg_port_setsadl(lp, CLLADDR(ifp->if_sadl));
- error = lagg_setmtu(ifp_port, ifp->if_mtu);
- if (error != 0)
- goto restore_sadl;
}
+ error = lagg_setmtu(ifp_port, ifp->if_mtu);
+ if (error != 0)
+ goto restore_sadl;
+
error = lagg_proto_allocport(sc, lp);
if (error != 0)
goto restore_mtu;
@@ -2263,9 +2264,6 @@ lagg_port_setup(struct lagg_softc *sc,
IFNET_UNLOCK(ifp_port);
if (is_1st_port) {
- error = lagg_setmtu(ifp, lp->lp_mtu);
- if (error != 0)
- goto restore_ifp_port;
if (lp->lp_iftype == IFT_ETHER &&
lagg_lladdr_equal(sc->sc_lladdr_rand,
CLLADDR(ifp->if_sadl))) {
@@ -2285,11 +2283,6 @@ lagg_port_setup(struct lagg_softc *sc,
return 0;
-restore_ifp_port:
- IFNET_LOCK(ifp_port);
- if (stopped) {
- if_stop(ifp_port, 0);
- }
free_port:
KASSERT(IFNET_LOCKED(ifp_port));
lagg_proto_freeport(sc, lp);