From owner-freebsd-net@FreeBSD.ORG Tue Feb 15 16:17:02 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76D611065670 for ; Tue, 15 Feb 2011 16:17:02 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2478FC15 for ; Tue, 15 Feb 2011 16:17:01 +0000 (UTC) Received: by iwn39 with SMTP id 39so319505iwn.13 for ; Tue, 15 Feb 2011 08:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=kYezw++rgE+la4xUiQvTAHuCkRR1nV+mQeoqUHozuGg=; b=UdRelGrZd0jy6S63+OA4dJ9xNTC/tRpNZpj11CX5k5GuSBHxlwj9lhYQO5nHwercds 9V7khz2jEm1I6kHGT8aF5Z62EKYoFFwZgx9T+m7GGH90s4DW5A1hL6KWgijXnyi5zE+Y q8wc1qqe+0XSoqvHVXG1fFsQ12hHEEKBVZoi8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=I+NhTjTooecOuN9qnjVddaBZ5xW5Asa+BXhN23kjk8mMLoxH8A5rGEFm4zHJCp9/s0 8AwmMX3QJMbup0N8imGvZ8kDxPnJnhLj+wldAckokR6m7BzRuN2GE8zWl12Ep460Tm0N LlCjRciPDRspjyKa+nyCtkwo8vvEDpeF1FpIM= MIME-Version: 1.0 Received: by 10.42.167.129 with SMTP id s1mr6935227icy.231.1297784862380; Tue, 15 Feb 2011 07:47:42 -0800 (PST) Received: by 10.42.164.201 with HTTP; Tue, 15 Feb 2011 07:47:42 -0800 (PST) In-Reply-To: References: Date: Tue, 15 Feb 2011 10:47:42 -0500 Message-ID: From: Arnaud Lacombe To: Nikolay Denev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org Subject: Re: ng_ether and vlan interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 16:17:02 -0000 Hi, On Tue, Feb 15, 2011 at 9:02 AM, Nikolay Denev wrote: > Hi, > > When trying to use ng_ether with vlan interfaces using the naming sheme $= {parent_if}.${vlan_tag} > it produces the following warning : > > =A0 =A0ng_ether_attach: can't name node ix0.512 > > And the newly created netgraph node stays . > > This is due to the following check in sys/netgraph/ng_base.c:ng_name_node= () : > > =A0 =A0 =A0 =A0/* Check the name is valid */ > =A0 =A0 =A0 =A0for (i =3D 0; i < NG_NODESIZ; i++) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (name[i] =3D=3D '\0' || name[i] =3D=3D = '.' || name[i] =3D=3D ':') > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0} > > Do we really do not want to allow dot in the name? >From sys/ng_base.c: /* * Find a node by absolute name. The name should NOT end with ':' * The name "." means "this node" and "[xxx]" means "the node * with ID (ie, at address) xxx". Moreover, several code path strictly assume that '.' is not repeated and enforce this. > If it's not an option to allow the dot, probably it would be better to re= place it with > underscore. > to name the current node ? It would be highly unintuitive. Also, you would be breaking all userland relying on '.' referring to the current node. Btw, ng_name_node() states that "Once assigned, the name cannot be changed.", however I can freely rename a node multiple time with ngctl. The comment might be bogus. - Arnaud > I can provide a patch if the change is acceptable. > > Cheers, > Nikolay_______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >