From owner-svn-src-all@freebsd.org Mon Nov 30 18:41:08 2020 Return-Path: Delivered-To: svn-src-all@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 1DEC94A49D8; Mon, 30 Nov 2020 18:41:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4ClDZp5HBlz4WKH; Mon, 30 Nov 2020 18:41:06 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 728CB260373; Mon, 30 Nov 2020 19:40:58 +0100 (CET) Subject: Re: svn commit: r366917 - in head: sbin/ifconfig sys/net tests/sys/net To: "Alexander V. Chernikov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010212128.09LLSK8d080756@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Mon, 30 Nov 2020 19:40:49 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <202010212128.09LLSK8d080756@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4ClDZp5HBlz4WKH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:c17:6c4b::2:from]; DMARC_NA(0.00)[selasky.org]; SPAMHAUS_ZRD(0.00)[2a01:4f8:c17:6c4b::2:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 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: Mon, 30 Nov 2020 18:41:08 -0000 On 10/21/20 11:28 PM, Alexander V. Chernikov wrote: > Author: melifaro > Date: Wed Oct 21 21:28:20 2020 > New Revision: 366917 > URL: https://svnweb.freebsd.org/changeset/base/366917 > > Log: > Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q). > > 802.1ad interfaces are created with ifconfig using the "vlanproto" parameter. > Eg., the following creates a 802.1Q VLAN (id #42) over a 802.1ad S-VLAN > (id #5) over a physical Ethernet interface (em0). > > ifconfig vlan5 create vlandev em0 vlan 5 vlanproto 802.1ad up > ifconfig vlan42 create vlandev vlan5 vlan 42 inet 10.5.42.1/24 > > VLAN_MTU, VLAN_HWCSUM and VLAN_TSO capabilities should be properly > supported. VLAN_HWTAGGING is only partially supported, as there is > currently no IFCAP_VLAN_* denoting the possibility to set the VLAN > EtherType to anything else than 0x8100 (802.1ad uses 0x88A8). > > Submitted by: Olivier Piras > Sponsored by: RG Nets > Differential Revision: https://reviews.freebsd.org/D26436 > Hi Alexander, Any vlan ending in . is now treated the same regardless of network device: Try this sequence of commands starting in any order ifconfig vlan create ifconfig igb0. create ifconfig igb1. create You'll quickly see that only the first command you pick succeeds. The subsequent ones will fail. must be the same number, for example 5. I'm not sure exactly where the problem is yet, but investigation shows that ifc_name2unit would return EINVAL on igb0. . Now it returns 0 (success) and puts into the *unit argument. > diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c > index a55ce9c3005..7f96757e12c 100644 > --- a/sys/net/if_clone.c > +++ b/sys/net/if_clone.c > @@ -582,9 +582,8 @@ ifc_name2unit(const char *name, int *unit) > int cutoff = INT_MAX / 10; > int cutlim = INT_MAX % 10; > > - if ((cp = strrchr(name, '.')) == NULL) > - cp = name; > - for (; *cp != '\0' && (*cp < '0' || *cp > '9'); cp++); > + for (cp = name; *cp != '\0' && (*cp < '0' || *cp > '9'); cp++) > + ; > if (*cp == '\0') { > *unit = -1; > } else if (cp[0] == '0' && cp[1] != '\0') { The chunk above is not a fix. Can you have a look at this. Should be easy to reproduce! Rolling back the kernel only to r366916 gives me: ifconfig igb1.11 create ifconfig: SIOCIFCREATE2: Invalid argument Rolling back ifconfig to r366916 aswell, gives me the expected result again: /usr/obj/usr/img/freebsd/amd64.amd64/sbin/ifconfig/ifconfig igb1.11 create /usr/obj/usr/img/freebsd/amd64.amd64/sbin/ifconfig/ifconfig vlan11 create --HPS