// GetCopy returns a copy of this SandboxInfo structure func (s *Info) GetCopy() *Info { list := make([]*Interface, len(s.Interfaces)) for i, iface := range s.Interfaces { list[i] = iface.GetCopy() } gw := netutils.GetIPCopy(s.Gateway) gw6 := netutils.GetIPCopy(s.GatewayIPv6) return &Info{Interfaces: list, Gateway: gw, GatewayIPv6: gw6} }
func (ep *endpoint) SetGatewayIPv6(gw6 net.IP) error { ep.Lock() defer ep.Unlock() ep.joinInfo.gw6 = netutils.GetIPCopy(gw6) return nil }
func (ep *endpoint) GatewayIPv6() net.IP { ep.Lock() defer ep.Unlock() if ep.joinInfo == nil { return net.IP{} } return netutils.GetIPCopy(ep.joinInfo.gw6) }