+ dhcpv6 server; support static leases
This commit is contained in:
@@ -47,6 +47,8 @@ type ServerConfig struct {
|
||||
// 0: disable
|
||||
ICMPTimeout uint32 `json:"icmp_timeout_msec" yaml:"icmp_timeout_msec"`
|
||||
|
||||
EnableV6 bool `yaml:"enable_v6"`
|
||||
|
||||
WorkDir string `json:"-" yaml:"-"`
|
||||
DBFilePath string `json:"-" yaml:"-"` // path to DB file
|
||||
|
||||
@@ -89,6 +91,9 @@ type Server struct {
|
||||
// IP address pool -- if entry is in the pool, then it's attached to a lease
|
||||
IPpool map[[4]byte]net.HardwareAddr
|
||||
|
||||
v6Leases []*Lease
|
||||
v6LeasesLock sync.RWMutex
|
||||
|
||||
conf ServerConfig
|
||||
|
||||
// Called when the leases DB is modified
|
||||
@@ -255,6 +260,13 @@ func (s *Server) Start() error {
|
||||
s.cond.Signal()
|
||||
}()
|
||||
|
||||
if s.conf.EnableV6 {
|
||||
err := s.v6Start()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user