Cc: Pavel On Fri, Jun 08, 2018 at 03:07:30AM -0700, Maciej Żenczykowski wrote: > I think we probably need to make sk->sk_reuse back into a boolean. > (ie. eliminate SK_FORCE_REUSE) > > Then add a new tcp/udp sk->ignore_bind_conflicts boolean setting... > (ie. not just for tcp, but sol_socket) [or perhaps SO_REPAIR, > sk->repair or something] > > What I'm not certain of is exactly what sorts of conflicts it should ignore... > all? probably not, still seems utterly wrong to allow creation of 2 connected > tcp sockets with identical 5-tuples. It is required when we are restoring i_b_c sockets on a server side. In this cases, they all have the same source address of a listening socket. To restore these sockets, we need to be able to create a listening socket and all i_b_c sockets and bind them all to the same source address. BTW: Here is an example of how tcp_repair works: https://github.com/avagin/tcp-repair/blob/master/tcp-constructor.c > > Would it only ignore conflicts against other i_b_c sockets? > ie. set it on all sockets as we're repairing, then clear it on them > all once we're done? TCP_REPAIR (which is set SK_FORCE_REUSE) is used to restore only i_b_c sockets. SK_FORCE_REUSE is needed to ignore bind conflicts for repaired sockets. It ignores conflicts agains other i_b_c and listen sockets. The current idea is that CRIU will restore listening sockets first, and them it will restore i_b_c sockets. Pls, take a look at the attached patch. > > and ignore all the fast caching when checking conflicts for an i_b_c socket? > > For CRIU is it safe to assume we're restoring an entire namespace into > a new namespace? No. It isn't. CRIU can restore processes in an existing network namespace. > > Could we perhaps instead allow a new namespace to ignore bind conflicts until > we flip it into enforcing mode? No, we could not