diff options
author | Andrea Barberio <insomniac@slackware.it> | 2018-11-09 15:44:57 +0000 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2018-11-12 09:36:40 +0000 |
commit | b388e716ca28ed5cb186e23a215a32d526d22cd0 (patch) | |
tree | ac7fe172f0c9631df2ed1ba811843bee21b03418 | |
parent | 01251f1da16d2734ca8e4fe503ba1c911ade2032 (diff) |
server: do not skip network errors in ActivateAndServe
-rw-r--r-- | dhcpv4/server.go | 5 | ||||
-rw-r--r-- | dhcpv6/server.go | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/dhcpv4/server.go b/dhcpv4/server.go index 7db4abe..130ef54 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) diff --git a/dhcpv6/server.go b/dhcpv6/server.go index 3fade87..1dad4be 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) |