Source-Changes-HG archive

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

[src/trunk]: src/sys/net decrease the MTU of vlan(4)



details:   https://anonhg.NetBSD.org/src/rev/2f388c61ff7a
branches:  trunk
changeset: 1026764:2f388c61ff7a
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Mon Dec 06 05:50:39 2021 +0000

description:
decrease the MTU of vlan(4)
only when ETHERCAP_VLAN_MTU of the parent interface is enabled

This fixed the bug that the MTU of a vlan interface is decreased
when the parent interface already has another vlan interface.
pointed out by tnn@n.o, thanks.

diffstat:

 sys/net/if_vlan.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 51557fe1488c -r 2f388c61ff7a sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Mon Dec 06 04:25:36 2021 +0000
+++ b/sys/net/if_vlan.c Mon Dec 06 05:50:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.165 2021/11/15 07:07:05 yamaguchi Exp $  */
+/*     $NetBSD: if_vlan.c,v 1.166 2021/12/06 05:50:39 yamaguchi Exp $  */
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.165 2021/11/15 07:07:05 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.166 2021/12/06 05:50:39 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -434,17 +434,16 @@
        case IFT_ETHER:
            {
                struct ethercom *ec = (void *)p;
-               bool vlanmtu_enabled;
 
                nmib->ifvm_msw = &vlan_ether_multisw;
                nmib->ifvm_encaplen = ETHER_VLAN_ENCAP_LEN;
                nmib->ifvm_mintu = ETHERMIN;
 
-               error = ether_add_vlantag(p, tag, &vlanmtu_enabled);
+               error = ether_add_vlantag(p, tag, NULL);
                if (error != 0)
                        goto done;
 
-               if (vlanmtu_enabled) {
+               if (ec->ec_capenable & ETHERCAP_VLAN_MTU) {
                        nmib->ifvm_mtufudge = 0;
                } else {
                        /*



Home | Main Index | Thread Index | Old Index