[systemd-devel] networkd: Support setting mtu / mac address by interface name

Tom Gundersen teg at jklm.no
Fri Dec 5 03:10:07 PST 2014

On 5 Dec 2014 10:07, "Marcel Holtmann" <marcel at holtmann.org> wrote:
> Hi Lennart,
> >>>> 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?
> you do realize that once the kernel renamed the name, it is free to reuse
that name again. So eth0 as OriginalName can then be present multiple times.
> I think that you can only have OriginalName matching if a renaming has
never occurred. Otherwise this is really not deterministic. Since foo0
(renamed from eth0) and and bar0 (renamed from eth0) will both match
OriginalName=eth0. The difference is only timing and that is inhering racy
of course.

Well, matching on kernel names is not sane, and I put a warning in the

The reason I left it in was that you could match on eth0 of you know it is
the only ethX device on your system, or you could match on eth* which would
also be  deterministic.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20141205/491ccfd0/attachment.html>

More information about the systemd-devel mailing list