diff options
author | Andrea Barberio <insomniac@slackware.it> | 2018-04-18 20:40:58 +0000 |
---|---|---|
committer | Andrea Barberio <insomniac@slackware.it> | 2018-04-18 20:40:58 +0000 |
commit | 038a263926d20ad709490399448c278e9c970515 (patch) | |
tree | 52bc2885f360ca8e7a25eab050841e3b343d8224 | |
parent | 4c8c5da7d31350d00fe53a35d2a0a85b64c0ec4f (diff) |
dhcpv6: Client.Exchange returns all the intermediate packets
-rw-r--r-- | dhcpv6/client.go | 8 |
1 files changed, 6 insertions, 2 deletions
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 } |