Date: Tue, 15 Feb 2011 10:47:42 -0500 From: Arnaud Lacombe <lacombar@gmail.com> To: Nikolay Denev <ndenev@gmail.com> Cc: freebsd-net@freebsd.org Subject: Re: ng_ether and vlan interfaces Message-ID: <AANLkTi=bVv_M=2ShVos113Y6ROsJ3_M3Qp-wBP8=B=bH@mail.gmail.com> In-Reply-To: <D275511D-0502-48ED-9186-EF4BF42B372E@gmail.com> References: <D275511D-0502-48ED-9186-EF4BF42B372E@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
On Tue, Feb 15, 2011 at 9:02 AM, Nikolay Denev <ndenev@gmail.com> wrote:
> Hi,
>
> When trying to use ng_ether with vlan interfaces using the naming sheme ${parent_if}.${vlan_tag}
> it produces the following warning :
>
> ng_ether_attach: can't name node ix0.512
>
> And the newly created netgraph node stays <unnamed>.
>
> This is due to the following check in sys/netgraph/ng_base.c:ng_name_node() :
>
> /* Check the name is valid */
> for (i = 0; i < NG_NODESIZ; i++) {
> if (name[i] == '\0' || name[i] == '.' || name[i] == ':')
> break;
> }
>
> 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 replace 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"
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=bVv_M=2ShVos113Y6ROsJ3_M3Qp-wBP8=B=bH>
