From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 18:39:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97164E57; Fri, 20 Feb 2015 18:39:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8294F680; Fri, 20 Feb 2015 18:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KIdC2U015325; Fri, 20 Feb 2015 18:39:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KIdCcW015324; Fri, 20 Feb 2015 18:39:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201502201839.t1KIdCcW015324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 20 Feb 2015 18:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279071 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2015 18:39:13 -0000 Author: delphij Date: Fri Feb 20 18:39:12 2015 New Revision: 279071 URL: https://svnweb.freebsd.org/changeset/base/279071 Log: Handle SIOCSIFCAP by propogating the request to the parent interface. This allows adding an vlan interface into a bridge. Thanks for William Katsak for testing and fixing an issue in my previous patch draft. MFC after: 2 weeks Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Fri Feb 20 18:06:33 2015 (r279070) +++ head/sys/net/if_vlan.c Fri Feb 20 18:39:12 2015 (r279071) @@ -1775,6 +1775,27 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd } break; + case SIOCSIFCAP: + VLAN_LOCK(); + if (TRUNK(ifv) != NULL) { + p = PARENT(ifv); + VLAN_UNLOCK(); + if ((p->if_type != IFT_ETHER) && + (ifr->ifr_reqcap & IFCAP_VLAN_HWTAGGING) == 0) { + error = EINVAL; + break; + } + error = (*p->if_ioctl)(p, cmd, data); + if (error) + break; + /* Propogate vlan interface capabilities */ + vlan_trunk_capabilities(p); + } else { + VLAN_UNLOCK(); + error = EINVAL; + } + break; + default: error = EINVAL; break;