Source-Changes-HG archive

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

[src/trunk]: src/sys/net Tweak vlan_unconfig



details:   https://anonhg.NetBSD.org/src/rev/572102d81fba
branches:  trunk
changeset: 803035:572102d81fba
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Sat Oct 11 10:18:36 2014 +0000

description:
Tweak vlan_unconfig

No functional change.

diffstat:

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

diffs (57 lines):

diff -r a7169766a962 -r 572102d81fba sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Sat Oct 11 10:16:49 2014 +0000
+++ b/sys/net/if_vlan.c Sat Oct 11 10:18:36 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.76 2014/10/11 10:16:49 ozaki-r Exp $     */
+/*     $NetBSD: if_vlan.c,v 1.77 2014/10/11 10:18:36 ozaki-r 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.76 2014/10/11 10:16:49 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.77 2014/10/11 10:18:36 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -362,10 +362,12 @@
 vlan_unconfig(struct ifnet *ifp)
 {
        struct ifvlan *ifv = ifp->if_softc;
+       struct ifnet *p;
 
        mutex_enter(&ifv_mtx);
+       p = ifv->ifv_p;
 
-       if (ifv->ifv_p == NULL) {
+       if (p == NULL) {
                mutex_exit(&ifv_mtx);
                return;
        }
@@ -378,20 +380,18 @@
        (*ifv->ifv_msw->vmsw_purgemulti)(ifv);
 
        /* Disconnect from parent. */
-       switch (ifv->ifv_p->if_type) {
+       switch (p->if_type) {
        case IFT_ETHER:
            {
-               struct ethercom *ec = (void *) ifv->ifv_p;
+               struct ethercom *ec = (void *) p;
 
                if (ec->ec_nvlans-- == 1) {
                        /*
                         * Disable Tx/Rx of VLAN-sized frames.
                         */
                        ec->ec_capenable &= ~ETHERCAP_VLAN_MTU;
-                       if (ifv->ifv_p->if_flags & IFF_UP) {
-                               (void)if_flags_set(ifv->ifv_p,
-                                   ifv->ifv_p->if_flags);
-                       }
+                       if (p->if_flags & IFF_UP)
+                               (void)if_flags_set(p, p->if_flags);
                }
 
                ether_ifdetach(ifp);



Home | Main Index | Thread Index | Old Index