diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 34316f30f67d..f718c8ab2c8e 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ethersubr.c,v 1.234 2017/01/10 05:42:34 ozaki-r Exp $ */ +/* $NetBSD: if_ethersubr.c,v 1.235 2017/01/13 06:11:56 msaitoh Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.234 2017/01/10 05:42:34 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.235 2017/01/13 06:11:56 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1475,10 +1475,6 @@ ether_enable_vlan_mtu(struct ifnet *ifp) int error; struct ethercom *ec = (void *)ifp; - /* Already have VLAN's do nothing. */ - if (ec->ec_nvlans != 0) - return 0; - /* Parent does not support VLAN's */ if ((ec->ec_capabilities & ETHERCAP_VLAN_MTU) == 0) return -1; diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 017dab7d9dbf..99f7b2154929 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vlan.c,v 1.93 2016/12/15 09:28:06 ozaki-r Exp $ */ +/* $NetBSD: if_vlan.c,v 1.94 2017/01/13 06:11:56 msaitoh Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.93 2016/12/15 09:28:06 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.94 2017/01/13 06:11:56 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -313,10 +313,12 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p) ifv->ifv_encaplen = ETHER_VLAN_ENCAP_LEN; ifv->ifv_mintu = ETHERMIN; - if (ec->ec_nvlans == 0) { + if (ec->ec_nvlans++ == 0) { if ((error = ether_enable_vlan_mtu(p)) >= 0) { - if (error) + if (error) { + ec->ec_nvlans--; return error; + } ifv->ifv_mtufudge = 0; } else { /* @@ -329,7 +331,6 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p) ifv->ifv_mtufudge = ifv->ifv_encaplen; } } - ec->ec_nvlans++; /* * If the parent interface can do hardware-assisted