summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dhcpv4/server.go7
-rw-r--r--dhcpv6/server.go7
2 files changed, 10 insertions, 4 deletions
diff --git a/dhcpv4/server.go b/dhcpv4/server.go
index 7db4abe..94e4578 100644
--- a/dhcpv4/server.go
+++ b/dhcpv4/server.go
@@ -115,7 +115,10 @@ func (s *Server) ActivateAndServe() error {
if err != nil {
switch err.(type) {
case net.Error:
- // silently skip and continue
+ if err.(net.Error).Timeout() {
+ return err
+ }
+ // if timeout, silently skip and continue
default:
// complain and continue
log.Printf("Error reading from packet conn: %v", err)
@@ -128,7 +131,7 @@ func (s *Server) ActivateAndServe() error {
log.Printf("Error parsing DHCPv4 request: %v", err)
continue
}
- s.Handler(pc, peer, m)
+ go s.Handler(pc, peer, m)
}
return nil
}
diff --git a/dhcpv6/server.go b/dhcpv6/server.go
index 3fade87..55a53e3 100644
--- a/dhcpv6/server.go
+++ b/dhcpv6/server.go
@@ -117,7 +117,10 @@ func (s *Server) ActivateAndServe() error {
if err != nil {
switch err.(type) {
case net.Error:
- // silently skip and continue
+ if !err.(net.Error).Timeout() {
+ return err
+ }
+ // if timeout, silently skip and continue
default:
//complain and continue
log.Printf("Error reading from packet conn: %v", err)
@@ -130,7 +133,7 @@ func (s *Server) ActivateAndServe() error {
log.Printf("Error parsing DHCPv6 request: %v", err)
continue
}
- s.Handler(pc, peer, m)
+ go s.Handler(pc, peer, m)
}
return nil
}