diff options
author | Allan Jude <allanjude@FreeBSD.org> | 2021-01-19 23:22:07 +0000 |
---|---|---|
committer | Allan Jude <allanjude@FreeBSD.org> | 2021-01-20 15:50:45 +0000 |
commit | b84d0aaa4e64fb95b105d0d38f6295fec7a82110 (patch) | |
tree | 4267098437bc0ba9ea3affd53d7691e2a5a4ed6b | |
parent | d70886d063166786ded0007af8cdcbf57b7b4827 (diff) | |
download | src-b84d0aaa4e64fb95b105d0d38f6295fec7a82110.tar.gz src-b84d0aaa4e64fb95b105d0d38f6295fec7a82110.zip |
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
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 5 | ||||
-rw-r--r-- | 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"); |