[libvirt] [PATCH v2] dots should be valid characters in interface names

Charles Duffy Charles_Duffy at messageone.com
Thu May 20 04:54:28 UTC 2010


On 05/19/2010 10:05 PM, Laine Stump wrote:
> On 05/19/2010 10:41 PM, Charles Duffy wrote:
>> The attached one-liner (built against RHEL6b1's libvirt but still
>> applicable against current master as of 10c681622) fixes this issue.
>
> I think we need to add ":" there as well (at least - maybe there are
> others), don't we?

In dev_valid_name() in net/core/dev.c, the following restrictions are 
enforced as of 2.6.27:

- Empty strings are disallowed
- Length must not meet or exceed 16 (IFNAMSIZ)
- '.' and '..' are each invalid as freestanding names (but accepted as 
part of a longer string)
- whitespace and '/' characters are prohibited at any point in the string

...and those are the only limitations in play.

Frankly, I'm a bit surprised colons are allowed -- my intuition was that 
they would be permitted only for named IPs rather than devices -- but 
such is the logic given here, and a bit of experimentation shows that 
the kernel accepts them (though they trigger bugs in iproute2, which 
appears in at least one place to make the same assumption I did; fun!)

A revised patch is attached. This lifts its logic from its kernel 
counterpart, and is updated only to permit forward slashes (which, while 
disallowed for interface names with the kernel, are required for 
*device* names -- for which the ESX driver happens to overload this 
field. Ugh).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-allow_dots_in_ifnames-r2.patch
Type: text/x-patch
Size: 1797 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100519/9b40e14e/attachment-0001.bin>


More information about the libvir-list mailing list