[CRIU] [PATCH 4/5] inet: remember ipv6 connections' ifindex for restore

Tycho Andersen tycho.andersen at canonical.com
Tue Nov 24 07:39:23 PST 2015


On Tue, Nov 24, 2015 at 02:08:16PM +0300, Andrew Vagin wrote:
> On Mon, Nov 23, 2015 at 01:55:27PM -0700, Tycho Andersen wrote:
> > For some ipv6 scope types (link local, amongo others), we need to tell the
> > kernel the ifindex of the interface whose address we want to bind to as
> > well as the address itself.
> >
> 
> Can we use SO_BINDTODEVICE to get this information?

Oh, probably. I didn't know about this flag. That would make things
much simpler. I'll check and see.

> diff --git a/test/zdtm/live/static/bridge.c b/test/zdtm/live/static/bridge.c
> index 06bff50..5bb9c40 100644
> --- a/test/zdtm/live/static/bridge.c
> +++ b/test/zdtm/live/static/bridge.c
> @@ -77,6 +77,13 @@ int main(int argc, char **argv)
>                 goto out;
>         }
>  
> +       {
> +               char name[1024];
> +               socklen_t len = 1024;
> +               getsockopt(sk, SOL_SOCKET, SO_BINDTODEVICE, &name, &len);
> +               pr_err("%s\n", name);
> +       }
> +
>         /* Here, we grep for inet because some of the IPV6 DAD stuff can be
>          * racy, and all we really care about is that the bridge got restored
>          * with the right MAC, since we know DAD will succeed eventually.
> 
> [root at fc22-vm criu]# cat test/zdtm/live/static/bridge.out
> 10:58:52.252:     4: ERR: bridge.c:84: zdtmbr0
> 10:58:52.261:     4: PASS

Not sure what this means?

Tycho


More information about the CRIU mailing list