[systemd-devel] [RFC] networkd/udev: match on 'ethernet' devices

Marcel Holtmann marcel at holtmann.org
Fri Jan 3 18:15:44 PST 2014


Hi Tom,

>>>>> I just pushed a change[0] which allows the match syntax
>>>>> "Type=ethernet" to match on network devices without a DEVTYPE.
>>>>> 
>>>>> We had a discussion on IRC whether we should call it Type=wired or
>>>>> Type=ethernet. I think the former may be more intuitive, but the
>>>>> latter seems to be more in line with what is done elsewhere (connman
>>>>> calls it ethernet, and udev prefixes the devices names with 'en').
>>>>> 
>>>>> Any thoughts?
>>>> 
>>>> Any reason why the kernel can't be setting this value in the first place
>>>> so you don't have to rely on it being "null"?
>>>> 
>>>> Seems like a kernel issue.
>>> 
>>> I asked Marcel the same thing earlier. He said:
>>> 
>>> [Friday 03 January 2014] [19:58:22] <holtmann>  Because you have to
>>> touch every single driver to get this done properly.
>>> [Friday 03 January 2014] [19:58:34] <holtmann>  So DEVTYPE= means it
>>> is wired Ethernet.
>>> [Friday 03 January 2014] [19:58:42] <holtmann>  If that is not true,
>>> then that is a bug.
>>> 
>>> From my point of view, I'd prefer the kernel just doing the right
>>> thing (and I'd be happy to write the patches), but my impression was
>>> that that's not going to happen...(?)
>> 
>> It shouldn't need to be set for every driver, wireless doesn't work this
>> way, so there is lots of precident for how to do this in only a few
>> lines of kernel code :)
>> 
>>> Also, if we start setting DEVTYPE=ethernet in the kernel, I guess apps
>>> (such as connman) that relies on DEVTYPE=(null) to detect ethernet
>>> devices will break.
>> 
>> Ah, that's a different problem, we can't break userspace.
>> 
>> Ugh, well, if you want me to try to make this change, I will.
> 
> If you see a way to make it happen, that'd be great (and I can revert
> this patch).

we can easily update ConnMan to handle DEVTYPE= and DEVTYPE=ethernet. That is an easy change and will keep things working. As I explained in the other reply, the main reason for DEVTYPE=<something> is to detect that it is a network device that needs a management entity before it becomes useful.

You also need to check the ARPHRD_ type of an interface to make sure it is actually Ethernet and not just rely on what DEVTYPE= is telling you. We are having the case with Bluetooth right now that you get DEVTYPE=bluetooth, but one of them is Ethernet emulation via BNEP and the other raw IP via 6loWPAN.

Regards

Marcel



More information about the systemd-devel mailing list