diff options
author | Pablo Mazzini <pmazzini@gmail.com> | 2018-08-03 11:21:52 +0200 |
---|---|---|
committer | Pablo Mazzini <pmazzini@gmail.com> | 2018-08-10 14:43:25 +0200 |
commit | 782ff7524ce2fce9b098ad72c020a489735557a1 (patch) | |
tree | 6facd9f53f534e2a4f0fccc6d9a2d6330d9f58a3 /dhcpv4 | |
parent | 6539e106ea55e534d7afcc04df6828c7de9d4e8f (diff) |
NewRequestFromOffer: update client
Diffstat (limited to 'dhcpv4')
-rw-r--r-- | dhcpv4/client.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dhcpv4/client.go b/dhcpv4/client.go index db7e71a..36ff60b 100644 --- a/dhcpv4/client.go +++ b/dhcpv4/client.go @@ -124,8 +124,8 @@ func MakeListeningSocket(ifname string) (int, error) { // ordered as Discovery, Offer, Request and Acknowledge. In case of errors, an // error is returned, and the list of DHCPv4 objects will be shorted than 4, // containing all the sent and received DHCPv4 messages. -func (c *Client) Exchange(ifname string, discover *DHCPv4, modifiers ...Modifier) ([]DHCPv4, error) { - conversation := make([]DHCPv4, 1) +func (c *Client) Exchange(ifname string, discover *DHCPv4, modifiers ...Modifier) ([]*DHCPv4, error) { + conversation := make([]*DHCPv4, 1) var err error // Get our file descriptor for the broadcast socket. @@ -155,21 +155,21 @@ func (c *Client) Exchange(ifname string, discover *DHCPv4, modifiers ...Modifier if err != nil { return conversation, err } - conversation = append(conversation, *offer) + conversation = append(conversation, offer) // Request - request, err := RequestFromOffer(*offer, modifiers...) + request, err := NewRequestFromOffer(offer, modifiers...) if err != nil { return conversation, err } - conversation = append(conversation, *request) + conversation = append(conversation, request) // Ack ack, err := BroadcastSendReceive(sfd, rfd, request, c.ReadTimeout, c.WriteTimeout, MessageTypeAck) if err != nil { return conversation, err } - conversation = append(conversation, *ack) + conversation = append(conversation, ack) return conversation, nil } |