summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/async/client_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/async/client_test.go')
-rw-r--r--dhcpv4/async/client_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/dhcpv4/async/client_test.go b/dhcpv4/async/client_test.go
index b134afe..2269d57 100644
--- a/dhcpv4/async/client_test.go
+++ b/dhcpv4/async/client_test.go
@@ -26,7 +26,9 @@ func serve(ctx context.Context, addr *net.UDPAddr, response *dhcpv4.DHCPv4) erro
case <-ctx.Done():
return
default:
- conn.SetReadDeadline(time.Now().Add(1 * time.Second))
+ if err := conn.SetReadDeadline(time.Now().Add(1 * time.Second)); err != nil {
+ panic(err)
+ }
n, _, _, src, err := conn.ReadMsgUDP(buffer, oobdata)
if err != nil {
continue
@@ -35,7 +37,9 @@ func serve(ctx context.Context, addr *net.UDPAddr, response *dhcpv4.DHCPv4) erro
if err != nil {
continue
}
- conn.SetWriteDeadline(time.Now().Add(1 * time.Second))
+ if err := conn.SetWriteDeadline(time.Now().Add(1 * time.Second)); err != nil {
+ panic(err)
+ }
_, err = conn.WriteTo(response.ToBytes(), src)
if err != nil {
continue