Hi,

On Tue, Feb 15, 2011 at 9:02 AM, Nikolay Denev <nde...@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-unsubscr...@freebsd.org"
>
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to