Example #1
0
File: daemon.go Project: tdr130/oz
func NetReconfigure(stn *SandboxNetwork, htn *HostNetwork, childPid int, log *logging.Logger) error {
	if os.Getpid() == 1 {
		panic(errors.New("Cannot use NetReconfigure from child."))
	}
	tenus.DeleteLink(stn.VethHost)
	if err := NetInit(stn, htn, log); err != nil {
		return err
	}
	return NetAttach(stn, htn, childPid)
}
Example #2
0
File: daemon.go Project: tdr130/oz
func (stn *SandboxNetwork) Cleanup(log *logging.Logger) {
	if os.Getpid() == 1 {
		panic(errors.New("Cannot use Cleanup from child."))
	}

	if _, err := net.InterfaceByName(stn.VethHost); err != nil {
		log.Info("No veth found to cleanup")
		return
	}

	tenus.DeleteLink(stn.VethHost)
}