From owner-dev-commits-src-main@freebsd.org Wed Jan 20 15:50:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FD754FA5F0; Wed, 20 Jan 2021 15:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DLVNp0w0gz3CsZ; Wed, 20 Jan 2021 15:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 125211BF13; Wed, 20 Jan 2021 15:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10KFoosK008513; Wed, 20 Jan 2021 15:50:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10KFooYA008512; Wed, 20 Jan 2021 15:50:50 GMT (envelope-from git) Date: Wed, 20 Jan 2021 15:50:50 GMT Message-Id: <202101201550.10KFooYA008512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: b84d0aaa4e64 - main - ifconfig: add vlanproto "qiniq" as an alias for "802.1ad" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b84d0aaa4e64fb95b105d0d38f6295fec7a82110 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2021 15:50:50 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=b84d0aaa4e64fb95b105d0d38f6295fec7a82110 commit b84d0aaa4e64fb95b105d0d38f6295fec7a82110 Author: Allan Jude AuthorDate: 2021-01-19 23:22:07 +0000 Commit: Allan Jude CommitDate: 2021-01-20 15:50:45 +0000 ifconfig: add vlanproto "qiniq" as an alias for "802.1ad" QinQ is better known by this name, so accept it as an alias Reported-by: Mike Geiger Reviewed-by: melifaro, hselasky, rpokala MFC-with: 366917 Sponsored-by: Klara Inc. Differential-Revision: https://reviews.freebsd.org/D28245 --- sbin/ifconfig/ifconfig.8 | 5 +++++ sbin/ifconfig/ifvlan.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index c1ffb6a82ccc..bbaaa00d419b 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -2706,6 +2706,11 @@ and .Dq 802.1ad . The default encapsulation protocol is .Dq 802.1Q . +The +.Dq 802.1ad +protocol is also commonly known as +.Dq QinQ ; +either name can be used. .It Cm vlanpcp Ar priority_code_point Priority code point .Pq Dv PCP diff --git a/sbin/ifconfig/ifvlan.c b/sbin/ifconfig/ifvlan.c index f316b0404459..60f97338ee27 100644 --- a/sbin/ifconfig/ifvlan.c +++ b/sbin/ifconfig/ifvlan.c @@ -68,6 +68,7 @@ static const char rcsid[] = static const char proto_8021Q[] = "802.1q"; static const char proto_8021ad[] = "802.1ad"; +static const char proto_qinq[] = "qinq"; static struct vlanreq params = { .vlr_tag = NOTAG, @@ -220,8 +221,8 @@ DECL_CMD_FUNC(setvlanproto, val, d) if (strncasecmp(proto_8021Q, val, strlen(proto_8021Q)) == 0) { params.vlr_proto = ETHERTYPE_VLAN; - } else if (strncasecmp(proto_8021ad, val, - strlen(proto_8021ad)) == 0) { + } else if ((strncasecmp(proto_8021ad, val, strlen(proto_8021ad)) == 0) + || (strncasecmp(proto_qinq, val, strlen(proto_qinq)) == 0)) { params.vlr_proto = ETHERTYPE_QINQ; } else errx(1, "invalid value for vlanproto");