Date: Fri, 10 Apr 2015 09:50:14 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281363 - in head: share/man/man4 sys/net Message-ID: <201504100950.t3A9oEVG092995@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Fri Apr 10 09:50:13 2015 New Revision: 281363 URL: https://svnweb.freebsd.org/changeset/base/281363 Log: Redo r274966. Instead of global all-interface all-vnet undocumented sysctl, use per-interface flag, and document it. Sponsored by: Nginx, Inc. Modified: head/share/man/man4/tap.4 head/sys/net/if_tap.c Modified: head/share/man/man4/tap.4 ============================================================================== --- head/share/man/man4/tap.4 Fri Apr 10 09:37:53 2015 (r281362) +++ head/share/man/man4/tap.4 Fri Apr 10 09:50:13 2015 (r281363) @@ -1,7 +1,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd November 30, 2014 +.Dd April 10, 2015 .Dt TAP 4 .Os .Sh NAME @@ -275,7 +275,9 @@ brought down .Dq ifconfig tap Ns Sy N No down ) unless the device is a .Em VMnet -device. +device, or has +.Dv IFF_LINK0 +flag set. All queued frames are thrown away. If the interface is up when the data device is not open, output frames are thrown away rather than Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Fri Apr 10 09:37:53 2015 (r281362) +++ head/sys/net/if_tap.c Fri Apr 10 09:50:13 2015 (r281363) @@ -156,7 +156,6 @@ static int tapdebug = 0; /* deb static int tapuopen = 0; /* allow user open() */ static int tapuponopen = 0; /* IFF_UP on open() */ static int tapdclone = 1; /* enable devfs cloning */ -static int tapclosedeladdrs = 1; /* del addrs on close */ static SLIST_HEAD(, tap_softc) taphead; /* first device */ static struct clonedevs *tapclones; @@ -173,9 +172,6 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, up_o "Bring interface up when /dev/tap is opened"); SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTLFLAG_RWTUN, &tapdclone, 0, "Enably legacy devfs interface creation"); -SYSCTL_INT(_net_link_tap, OID_AUTO, deladdrs_on_close, CTLFLAG_RW, - &tapclosedeladdrs, 0, "Delete addresses and routes when /dev/tap is " - "closed"); SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); DEV_MODULE(if_tap, tapmodevent, NULL); @@ -536,12 +532,11 @@ tapclose(struct cdev *dev, int foo, int IF_DRAIN(&ifp->if_snd); /* - * do not bring the interface down, and do not anything with - * interface, if we are in VMnet mode. just close the device. + * Do not bring the interface down, and do not anything with + * interface, if we are in VMnet mode. Just close the device. */ - - if (tapclosedeladdrs == 1 && ((tp->tap_flags & TAP_VMNET) == 0) && - (ifp->if_flags & IFF_UP)) { + if (((tp->tap_flags & TAP_VMNET) == 0) && + (ifp->if_flags & (IFF_UP | IFF_LINK0)) == IFF_UP) { mtx_unlock(&tp->tap_mtx); if_down(ifp); mtx_lock(&tp->tap_mtx);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504100950.t3A9oEVG092995>