minor
This commit is contained in:
@@ -234,20 +234,13 @@ func (s *Server) setConfig(config ServerConfig) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start will listen on port 67 and serve DHCP requests.
|
func (s *Server) start4(iface net.Interface) error {
|
||||||
func (s *Server) Start() error {
|
|
||||||
// TODO: don't close if interface and addresses are the same
|
// TODO: don't close if interface and addresses are the same
|
||||||
if s.conn != nil {
|
if s.conn != nil {
|
||||||
_ = s.closeConn()
|
_ = s.closeConn()
|
||||||
}
|
}
|
||||||
|
|
||||||
iface, err := net.InterfaceByName(s.conf.InterfaceName)
|
c, err := newFilterConn(iface, ":67") // it has to be bound to 0.0.0.0:67, otherwise it won't see DHCP discover/request packets
|
||||||
if err != nil {
|
|
||||||
return wrapErrPrint(err, "Couldn't find interface by name %s", s.conf.InterfaceName)
|
|
||||||
}
|
|
||||||
|
|
||||||
if false {
|
|
||||||
c, err := newFilterConn(*iface, ":67") // it has to be bound to 0.0.0.0:67, otherwise it won't see DHCP discover/request packets
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return wrapErrPrint(err, "Couldn't start listening socket on 0.0.0.0:67")
|
return wrapErrPrint(err, "Couldn't start listening socket on 0.0.0.0:67")
|
||||||
}
|
}
|
||||||
@@ -267,6 +260,19 @@ func (s *Server) Start() error {
|
|||||||
s.running = false
|
s.running = false
|
||||||
s.cond.Signal()
|
s.cond.Signal()
|
||||||
}()
|
}()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start will listen on port 67 and serve DHCP requests.
|
||||||
|
func (s *Server) Start() error {
|
||||||
|
iface, err := net.InterfaceByName(s.conf.InterfaceName)
|
||||||
|
if err != nil {
|
||||||
|
return wrapErrPrint(err, "Couldn't find interface by name %s", s.conf.InterfaceName)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = s.start4(*iface)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.srv6.Start(*iface)
|
err = s.srv6.Start(*iface)
|
||||||
|
|||||||
Reference in New Issue
Block a user