summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/bsdp
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-11-27 22:15:54 +0000
committerinsomniac <insomniacslk@users.noreply.github.com>2018-11-27 22:15:54 +0000
commit319e92b03a0b85eeaee17398b72ee759b2ccf905 (patch)
tree5c3427a22d5e293835b6f60f2d9c58187352eb33 /dhcpv4/bsdp
parentee4c6d2553989a433e4a13fb130616061558db48 (diff)
simplify client interface (#181)
Diffstat (limited to 'dhcpv4/bsdp')
-rw-r--r--dhcpv4/bsdp/client.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/dhcpv4/bsdp/client.go b/dhcpv4/bsdp/client.go
index 8131bec..dd9cbcd 100644
--- a/dhcpv4/bsdp/client.go
+++ b/dhcpv4/bsdp/client.go
@@ -34,7 +34,7 @@ func castVendorOpt(ack *dhcpv4.DHCPv4) {
// Exchange runs a full BSDP exchange (Inform[list], Ack, Inform[select],
// Ack). Returns a list of DHCPv4 structures representing the exchange.
-func (c *Client) Exchange(ifname string, informList *dhcpv4.DHCPv4) ([]*dhcpv4.DHCPv4, error) {
+func (c *Client) Exchange(ifname string) ([]*dhcpv4.DHCPv4, error) {
conversation := make([]*dhcpv4.DHCPv4, 0)
// Get our file descriptor for the broadcast socket.
@@ -48,11 +48,9 @@ func (c *Client) Exchange(ifname string, informList *dhcpv4.DHCPv4) ([]*dhcpv4.D
}
// INFORM[LIST]
- if informList == nil {
- informList, err = NewInformListForInterface(ifname, dhcpv4.ClientPort)
- if err != nil {
- return conversation, err
- }
+ informList, err := NewInformListForInterface(ifname, dhcpv4.ClientPort)
+ if err != nil {
+ return conversation, err
}
conversation = append(conversation, informList)