From 038a263926d20ad709490399448c278e9c970515 Mon Sep 17 00:00:00 2001 From: Andrea Barberio Date: Wed, 18 Apr 2018 20:40:58 +0000 Subject: dhcpv6: Client.Exchange returns all the intermediate packets --- dhcpv6/client.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dhcpv6') diff --git a/dhcpv6/client.go b/dhcpv6/client.go index f46854c..3e79a0a 100644 --- a/dhcpv6/client.go +++ b/dhcpv6/client.go @@ -44,17 +44,21 @@ func (c *Client) Exchange(ifname string, solicit DHCPv6) ([]DHCPv6, error) { // Solicit solicit, advertise, err := c.Solicit(ifname, solicit) + if solicit != nil { + conversation = append(conversation, solicit) + } if err != nil { return conversation, err } - conversation = append(conversation, solicit) conversation = append(conversation, advertise) request, reply, err := c.Request(ifname, advertise, nil) + if request != nil { + conversation = append(conversation, request) + } if err != nil { return conversation, err } - conversation = append(conversation, request) conversation = append(conversation, reply) return conversation, nil } -- cgit v1.2.3