Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/f7cf2a0b2215
branches:  netbsd-6
changeset: 776755:f7cf2a0b2215
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Nov 03 20:38:09 2014 +0000

description:
Pull up following revision(s) (requested by ozaki-r in ticket #1156):
        sbin/ifconfig/vlan.c: revision 1.14
        sbin/ifconfig/ifconfig.8: revision 1.108
        sys/net/if_vlan.c: revision 1.71
        sys/net/if_vlan.c: revision 1.73
        sys/net/if_vlan.c: revision 1.74
- PR#49114: Write about -vlanif in ifconfig.8.
  Add -vlanif to the help message of ifconfig.
- PR#49196: Leave promiscuous mode when detaching a parent (ifconfig -vlanif)
  We have to call ifpromisc(ifp, 0) for both a VLAN interface
  and its parent when they are in promiscuous mode.
- PR#49197: Delete link local addresses of a vlan interface when detaching its
  parent.
- PR#49112: Restore vlan_ioctl overwritten by ether_ifdetach in vlan_unconfig

diffstat:

 sbin/ifconfig/ifconfig.8 |  10 ++++++++--
 sbin/ifconfig/vlan.c     |   6 +++---
 sys/net/if_vlan.c        |  18 ++++++++++++++++--
 3 files changed, 27 insertions(+), 7 deletions(-)

diffs (118 lines):

diff -r b89b7825e69c -r f7cf2a0b2215 sbin/ifconfig/ifconfig.8
--- a/sbin/ifconfig/ifconfig.8  Mon Nov 03 20:01:51 2014 +0000
+++ b/sbin/ifconfig/ifconfig.8  Mon Nov 03 20:38:09 2014 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ifconfig.8,v 1.104 2012/01/28 15:01:44 mbalmer Exp $
+.\"    $NetBSD: ifconfig.8,v 1.104.2.1 2014/11/03 20:38:09 msaitoh 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
@@ -633,6 +633,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 b89b7825e69c -r f7cf2a0b2215 sbin/ifconfig/vlan.c
--- a/sbin/ifconfig/vlan.c      Mon Nov 03 20:01:51 2014 +0000
+++ b/sbin/ifconfig/vlan.c      Mon Nov 03 20:38:09 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.8.1 2014/11/03 20:38:09 msaitoh 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.8.1 2014/11/03 20:38:09 msaitoh 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 b89b7825e69c -r f7cf2a0b2215 sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Mon Nov 03 20:01:51 2014 +0000
+++ b/sys/net/if_vlan.c Mon Nov 03 20:38:09 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.69.8.1 2014/06/03 15:34:00 msaitoh Exp $ */
+/*     $NetBSD: if_vlan.c,v 1.69.8.2 2014/11/03 20:38:09 msaitoh 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.69.8.1 2014/06/03 15:34:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.69.8.2 2014/11/03 20:38:09 msaitoh 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;
                }



Home | Main Index | Thread Index | Old Index