Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net/lagg Set flags related to MTU on adding l2tp(4) to l...



details:   https://anonhg.NetBSD.org/src/rev/194e1bb7b9e6
branches:  trunk
changeset: 364602:194e1bb7b9e6
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Thu Mar 31 03:07:05 2022 +0000

description:
Set flags related to MTU on adding l2tp(4) to lagg(4)

diffstat:

 sys/net/lagg/if_lagg.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r f344cde4977f -r 194e1bb7b9e6 sys/net/lagg/if_lagg.c
--- a/sys/net/lagg/if_lagg.c    Thu Mar 31 03:05:41 2022 +0000
+++ b/sys/net/lagg/if_lagg.c    Thu Mar 31 03:07:05 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lagg.c,v 1.38 2022/03/31 02:00:27 yamaguchi Exp $   */
+/*     $NetBSD: if_lagg.c,v 1.39 2022/03/31 03:07:05 yamaguchi Exp $   */
 
 /*
  * Copyright (c) 2005, 2006 Reyk Floeter <reyk%openbsd.org@localhost>
@@ -20,7 +20,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.38 2022/03/31 02:00:27 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.39 2022/03/31 03:07:05 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1949,11 +1949,17 @@
        ena = ~0;
        cap = ~0;
        LAGG_PORTS_FOREACH(sc, lp) {
-               if (lp->lp_iftype == IFT_ETHER) {
+               switch (lp->lp_iftype) {
+               case IFT_ETHER:
                        ec = (struct ethercom *)lp->lp_ifp;
                        ena &= ec->ec_capenable;
                        cap &= ec->ec_capabilities;
-               } else {
+                       break;
+               case IFT_L2TP:
+                       ena &= (ETHERCAP_VLAN_MTU | ETHERCAP_JUMBO_MTU);
+                       cap &= (ETHERCAP_VLAN_MTU | ETHERCAP_JUMBO_MTU);
+                       break;
+               default:
                        ena = 0;
                        cap = 0;
                }



Home | Main Index | Thread Index | Old Index