Source-Changes-HG archive

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

[src/netbsd-7]: src Pull up following revision(s) (requested by ozaki-r in ti...



details:   https://anonhg.NetBSD.org/src/rev/b7b7fefaebe7
branches:  netbsd-7
changeset: 798371:b7b7fefaebe7
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Sep 22 10:44:37 2014 +0000

description:
Pull up following revision(s) (requested by ozaki-r in ticket #108):
        sbin/ifconfig/vlan.c: revision 1.14
        sbin/ifconfig/ifconfig.8: revision 1.108
        sys/net/if_vlan.c: revision 1.71-1.74

Document -vlanif in ifconfig.8 and in usage measseg (PR 49114).
Leave promiscuous mode when detaching a parent (PR 49196) and
delete link local addresses (49197).
Restore vlan_ioctl overwritten by ether_ifdetach in vlan_unconfig
(PR 49112).
Call if_input of vlan interface itself, not parent one.
This allows bridging vlan interfaces again.

diffstat:

 sbin/ifconfig/ifconfig.8 |  10 ++++++++--
 sbin/ifconfig/vlan.c     |   6 +++---
 sys/net/if_vlan.c        |  22 ++++++++++++++++++----
 3 files changed, 29 insertions(+), 9 deletions(-)

diffs (127 lines):

diff -r a59a6cfb2e5b -r b7b7fefaebe7 sbin/ifconfig/ifconfig.8
--- a/sbin/ifconfig/ifconfig.8  Sun Sep 21 19:02:39 2014 +0000
+++ b/sbin/ifconfig/ifconfig.8  Mon Sep 22 10:44:37 2014 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ifconfig.8,v 1.106 2014/01/07 20:25:24 degroote Exp $
+.\"    $NetBSD: ifconfig.8,v 1.106.4.1 2014/09/22 10:44:37 martin Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)ifconfig.8 8.4 (Berkeley) 6/1/94
 .\"
-.Dd January 28, 2012
+.Dd September 15, 2014
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -634,6 +634,12 @@
 and
 .Cm vlan
 must be set at the same time.
+.It Cm -vlanif Ar iface
+Dissociate
+.Ar iface
+from the
+.Xr vlan 4
+interface.
 .It Cm agrport Ar iface
 Add
 .Ar iface
diff -r a59a6cfb2e5b -r b7b7fefaebe7 sbin/ifconfig/vlan.c
--- a/sbin/ifconfig/vlan.c      Sun Sep 21 19:02:39 2014 +0000
+++ b/sbin/ifconfig/vlan.c      Mon Sep 22 10:44:37 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vlan.c,v 1.13 2009/07/28 18:22:33 dyoung Exp $ */
+/*     $NetBSD: vlan.c,v 1.13.24.1 2014/09/22 10:44:37 martin Exp $    */
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: vlan.c,v 1.13 2009/07/28 18:22:33 dyoung Exp $");
+__RCSID("$NetBSD: vlan.c,v 1.13.24.1 2014/09/22 10:44:37 martin Exp $");
 #endif /* not lint */
 
 #include <sys/param.h> 
@@ -175,7 +175,7 @@
 static void
 vlan_usage(prop_dictionary_t env)
 {
-       fprintf(stderr, "\t[ vlan n vlanif i ]\n");
+       fprintf(stderr, "\t[ vlan n vlanif i ] [ -vlanif i ]\n");
 }
 
 static void
diff -r a59a6cfb2e5b -r b7b7fefaebe7 sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Sun Sep 21 19:02:39 2014 +0000
+++ b/sys/net/if_vlan.c Mon Sep 22 10:44:37 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.70 2014/05/13 19:36:16 bouyer Exp $      */
+/*     $NetBSD: if_vlan.c,v 1.70.2.1 2014/09/22 10:44:37 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.70 2014/05/13 19:36:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.70.2.1 2014/09/22 10:44:37 martin Exp $");
 
 #include "opt_inet.h"
 
@@ -103,6 +103,9 @@
 #include <netinet/in.h>
 #include <netinet/if_inarp.h>
 #endif
+#ifdef INET6
+#include <netinet6/in6_ifattach.h>
+#endif
 
 struct vlan_mc_entry {
        LIST_ENTRY(vlan_mc_entry)       mc_entries;
@@ -384,6 +387,8 @@
                }
 
                ether_ifdetach(ifp);
+               /* Restore vlan_ioctl overwritten by ether_ifdetach */
+               ifp->if_ioctl = vlan_ioctl;
                vlan_reset_linkname(ifp);
                break;
            }
@@ -398,6 +403,12 @@
        ifv->ifv_if.if_mtu = 0;
        ifv->ifv_flags = 0;
 
+#ifdef INET6
+       /* To delete v6 link local addresses */
+       in6_ifdetach(ifp);
+#endif
+       if ((ifp->if_flags & IFF_PROMISC) != 0)
+               ifpromisc(ifp, 0);
        if_down(ifp);
        ifp->if_flags &= ~(IFF_UP|IFF_RUNNING);
        ifp->if_capabilities = 0;
@@ -482,6 +493,9 @@
                if ((error = copyin(ifr->ifr_data, &vlr, sizeof(vlr))) != 0)
                        break;
                if (vlr.vlr_parent[0] == '\0') {
+                       if (ifv->ifv_p != NULL &&
+                           (ifp->if_flags & IFF_PROMISC) != 0)
+                               error = ifpromisc(ifv->ifv_p, 0);
                        vlan_unconfig(ifp);
                        break;
                }
@@ -893,6 +907,6 @@
 
        bpf_mtap(&ifv->ifv_if, m);
 
-       /* Pass it back through the parent's input routine. */
-       (*ifp->if_input)(&ifv->ifv_if, m);
+       m->m_flags &= ~M_PROMISC;
+       ifv->ifv_if.if_input(&ifv->ifv_if, m);
 }



Home | Main Index | Thread Index | Old Index