[systemd-devel] [PATCH] libnetworkd: only allow positive ifindex

Tom Gundersen teg at jklm.no
Sat Apr 12 12:59:52 PDT 2014


On Sat, Apr 12, 2014 at 7:26 PM, Zbigniew Jędrzejewski-Szmek
<zbyszek at in.waw.pl> wrote:
> On Sat, Apr 12, 2014 at 01:19:48PM +0200, Umut Tezduyar Lindskog wrote:
>> Patch doesn't apply anymore after reference counting changes. I will
>> re-send it along with ipv4ll tests which is coming up right away.
> Cool. Could you add a bit of a commit message explaining the change for
> the poor ignorant sods like me who don't know why indexes start at 0 or 1?

FWIW: the kernel starts enumerating interfaces at 1 [0]. Varies API's
accept ifindex=0 to refer to "unknown"/"any"/"all" interfaces. That's
not useful in these libraries though, as we only want to run these
clients on a given interface, so restricting to ifindex > 0 makes
sense.

Umut, will you resend with a bit more detailed commit message or
should I fix it up when applying your patch?

Cheers,

Tom

[0]: <https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/net/core/dev.c#n5524>


More information about the systemd-devel mailing list