You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a PhantomData and zero sized struct we can attach an additional
generic data for either the host or container namespace to the struct.
Because it is zero sized and not used it is optimized away and only the
type checker sees it to enforce the right types are used.
With that we basically create two different netlink socket types
Socket<HostNS> and Socket<ContainerNS> so they must be used in all type
signatures from now on. To keep the changes smaller I have set HostNS as
default generic for the struct so we don't need to change most function
signatures.
For al call sides where we pass sockets around the compiler now enforces
that we use the right ones avoid any possible mix ups.
Signed-off-by: Paul Holzinger <[email protected]>
0 commit comments