ng_ether and vlan interfaces

Julian Elischer julian at freebsd.org
Tue Feb 15 16:30:22 UTC 2011


On 2/15/11 7:47 AM, Arnaud Lacombe wrote:
> Hi,
>
> On Tue, Feb 15, 2011 at 9:02 AM, Nikolay Denev<ndenev at 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
>

check teh code and if it is true, (no leaks are found and no race 
conditinas are created)
then send a patch and we'll see about getting the fix in..

>> I can provide a patch if the change is acceptable.
changing it to '_' might be accceptable,  '.' is much like '/' in th 
filesystem.
it is a separator. You can't have it in the name.
a patch that converted . to _ would be a nice idea.
please ensure that the man page is updated as well.




>> Cheers,
>> Nikolay_______________________________________________
>> freebsd-net at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-net
>> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>>
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>
>



More information about the freebsd-net mailing list