Module Name: src
Committed By: msaitoh
Date: Mon Nov 3 20:38:09 UTC 2014
Modified Files:
src/sbin/ifconfig [netbsd-6]: ifconfig.8 vlan.c
src/sys/net [netbsd-6]: if_vlan.c
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.104.2.1 src/sbin/ifconfig/ifconfig.8
cvs rdiff -u -r1.13 -r1.13.8.1 src/sbin/ifconfig/vlan.c
cvs rdiff -u -r1.69.8.1 -r1.69.8.2 src/sys/net/if_vlan.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.104 src/sbin/ifconfig/ifconfig.8:1.104.2.1
--- src/sbin/ifconfig/ifconfig.8:1.104 Sat Jan 28 15:01:44 2012
+++ src/sbin/ifconfig/ifconfig.8 Mon Nov 3 20:38:09 2014
@@ -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 @@ Note that
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
Index: src/sbin/ifconfig/vlan.c
diff -u src/sbin/ifconfig/vlan.c:1.13 src/sbin/ifconfig/vlan.c:1.13.8.1
--- src/sbin/ifconfig/vlan.c:1.13 Tue Jul 28 18:22:33 2009
+++ src/sbin/ifconfig/vlan.c Mon Nov 3 20:38:09 2014
@@ -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 @@ vlan_status(prop_dictionary_t env, prop_
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
Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.69.8.1 src/sys/net/if_vlan.c:1.69.8.2
--- src/sys/net/if_vlan.c:1.69.8.1 Tue Jun 3 15:34:00 2014
+++ src/sys/net/if_vlan.c Mon Nov 3 20:38:09 2014
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v
#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 @@ vlan_unconfig(struct ifnet *ifp)
}
ether_ifdetach(ifp);
+ /* Restore vlan_ioctl overwritten by ether_ifdetach */
+ ifp->if_ioctl = vlan_ioctl;
vlan_reset_linkname(ifp);
break;
}
@@ -398,6 +403,12 @@ vlan_unconfig(struct ifnet *ifp)
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 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd
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;
}