[systemd-devel] networkd: Support setting mtu / mac address by interface name
Tom Gundersen
teg at jklm.no
Thu Dec 4 11:17:13 PST 2014
On Thu, Dec 4, 2014 at 8:08 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Thu, 04.12.14 18:53, Tom Gundersen (teg at jklm.no) wrote:
>
>> >> Moreover, if we
>> >> give people this feature I'm pretty sure we'll get lots of people
>> >> expecting it to work also for any other sort of name and getting
>> >> confused when it doesn't.
>> >
>> > Well, this is something we can fix by documentation, no?
>> >
>> > Or maybe name the match option differently, maybe OriginalName= or
>> > KernelName= or so, and then only matching interfaces where you know
>> > that the name was selected by userspace in the first place?
>>
>> I like the idea of OriginalName, much less likely to get people
>> confused. I now implemented that, with the restriction that we cannot
>> match on renamed names. For now I left it open to match on ethX style
>> names, as people in principle could do sensible things like
>> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
>> only one interface.
>>
>> One thing to consider would be to disallow renaming from a .link file
>> where the OriginalName was used to match. That way we don't have the
>> somewhat odd situation that a .link file can only be applied once (we
>> do not remember the original name, so cannot match on that the second
>> time around, as that would be a mess)...
>
> Maybe we should even store the original name in a udev property, so
> that we can make this fully idempotent simply because we can always
> check this new property for the original name passed down from the
> kernel?
We got into lots of issues in the past with trying to track the
renaming from userspace (which is why NET_NAME_RENAMED and friends now
are exposed from the kernel), so I'd rather not get back into that
game. The issue is that processes can (and do) rename interfaces
outside of udev's control (possibly before udev is running), and we'll
then be left with knowing that a device was renamed (as the kernel
tells us that much), but not from what. I'd really prefer to keep this
dead simple and either say (as now) that the config is only applied
once if you rename the device, or say that the name-matching config
cannot rename.
-t
More information about the systemd-devel
mailing list