summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/client6
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2019-05-08 11:49:26 +0100
committerinsomniac <insomniacslk@users.noreply.github.com>2019-05-08 13:48:24 +0100
commit7f47189c0d8f5c8b06ab1787a94506fbb673e6e0 (patch)
tree54f3cdc124385c3f6ef57f029415aedf1fdacec0 /dhcpv6/client6
parentc781bfa866afb5cac93f2fcbb5ef9da53a486087 (diff)
Addressed more linter warnings
Mostly addressed missing error checking. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
Diffstat (limited to 'dhcpv6/client6')
-rw-r--r--dhcpv6/client6/client.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/dhcpv6/client6/client.go b/dhcpv6/client6/client.go
index 3722579..091a58b 100644
--- a/dhcpv6/client6/client.go
+++ b/dhcpv6/client6/client.go
@@ -141,7 +141,9 @@ func (c *Client) sendReceive(ifname string, packet dhcpv6.DHCPv6, expectedType d
}
// send the packet out
- conn.SetWriteDeadline(time.Now().Add(c.WriteTimeout))
+ if err := conn.SetWriteDeadline(time.Now().Add(c.WriteTimeout)); err != nil {
+ return nil, err
+ }
_, err = conn.WriteTo(packet.ToBytes(), &raddr)
if err != nil {
return nil, err
@@ -149,7 +151,9 @@ func (c *Client) sendReceive(ifname string, packet dhcpv6.DHCPv6, expectedType d
// wait for a reply
oobdata := []byte{} // ignoring oob data
- conn.SetReadDeadline(time.Now().Add(c.ReadTimeout))
+ if err := conn.SetReadDeadline(time.Now().Add(c.ReadTimeout)); err != nil {
+ return nil, err
+ }
var (
adv dhcpv6.DHCPv6
isMessage bool