internal/dhcp6: fix error case

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2020-05-09 17:00:43 -04:00
parent 411780cd8e
commit b8c40958e8
No known key found for this signature in database
GPG Key ID: 77BFE531397EDE94

View File

@ -168,7 +168,7 @@ const maxUDPReceivedPacketSize = 8192 // arbitrary size. Theoretically could be
func (c *Client) sendReceive(packet *dhcpv6.Message, expectedType dhcpv6.MessageType) (*dhcpv6.Message, error) { func (c *Client) sendReceive(packet *dhcpv6.Message, expectedType dhcpv6.MessageType) (*dhcpv6.Message, error) {
if packet == nil { if packet == nil {
return nil, fmt.Errorf("Packet to send cannot be nil") return nil, fmt.Errorf("packet to send cannot be nil")
} }
if expectedType == dhcpv6.MessageTypeNone { if expectedType == dhcpv6.MessageTypeNone {
// infer the expected type from the packet being sent // infer the expected type from the packet being sent