Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/net Pull up following revision(s) (requested by msait...



details:   https://anonhg.NetBSD.org/src/rev/4c0fc03bdb47
branches:  netbsd-8
changeset: 434409:4c0fc03bdb47
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Nov 22 14:30:23 2017 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #368):
        sys/net/if_vlan.c: revision 1.101
        sys/net/if_vlan.c: revision 1.102
  Check if VLAN ID isn't duplicated on a same parent interface and return
EEXIST if it failed.
  Remove accidentally added code (for VLAN hardware filter).

diffstat:

 sys/net/if_vlan.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r 3bca1ed36298 -r 4c0fc03bdb47 sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Tue Nov 21 15:13:36 2017 +0000
+++ b/sys/net/if_vlan.c Wed Nov 22 14:30:23 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.97.2.6 2017/11/08 22:20:59 snj Exp $     */
+/*     $NetBSD: if_vlan.c,v 1.97.2.7 2017/11/22 14:30:23 martin 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.97.2.6 2017/11/08 22:20:59 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.7 2017/11/22 14:30:23 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -379,10 +379,12 @@
        struct ifnet *ifp = &ifv->ifv_if;
        struct ifvlan_linkmib *nmib = NULL;
        struct ifvlan_linkmib *omib = NULL;
+       struct ifvlan_linkmib *checkmib = NULL;
        struct psref_target *nmib_psref = NULL;
        int error = 0;
        int idx;
        bool omib_cleanup = false;
+       struct psref psref;
 
        nmib = kmem_alloc(sizeof(*nmib), KM_SLEEP);
 
@@ -394,6 +396,14 @@
                goto done;
        }
 
+       /* Duplicate check */
+       checkmib = vlan_lookup_tag_psref(p, tag, &psref);
+       if (checkmib != NULL) {
+               vlan_putref_linkmib(checkmib, &psref);
+               error = EEXIST;
+               goto done;
+       }
+
        *nmib = *omib;
        nmib_psref = &nmib->ifvm_psref;
 



Home | Main Index | Thread Index | Old Index