Subject: Re: [PATCH 1/2] net: Allow to create links with given ifindex

From: [email-masked] (Eric W. Biederman)
Date: Mon, 30 Jul 2012 03:56:47 -0700

[email-masked] (Eric W. Biederman) writes:

> Pavel Emelyanov <[email-masked]> writes:
>
>> Currently the RTM_NEWLINK results in -EOPNOTSUPP if the ifinfomsg->ifi_index
>> is not zero. I propose to allow requesting ifindices on link creation. This
>> is required by the checkpoint-restore to correctly restore a net namespace
>> (i.e. -- a container). The question what to do with pre-created devices such
>> as lo or sit fbdev is open, but for manually created devices this can be 
>> solved by this patch.
>
> Have you walked through and found the locations where we still rely on
> ifindex being globally unique?
>
> Last time I was working in this area there were serveral places where
> things were indexed by just the interface index.

If it is really safe to make ifindex per network namespace at this
point you can make dev_new_ifindex have a per network namespace base
counter, and that will fix your problems with the loopback device.

Unless you have done the work to root out the last of dependencies on
ifindex being globally unique I think you will run into some operational
problems.

Eric