diff options
author | Pablo Mazzini <pmazzini@gmail.com> | 2019-11-29 11:04:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-29 11:04:00 +0000 |
commit | 776f86289139a4fab9f49c1d9f5f96734b6fb654 (patch) | |
tree | d5a56356d4af33f243c093e783c8ad9a4b528857 /dhcpv4/nclient4/client.go | |
parent | 571b45e55159c08c11e87e5456c2aa31bdfef369 (diff) | |
parent | 73d51e8973f7e89fe1d2a988aaef7739c8696dd4 (diff) |
Merge pull request #336 from xaionaro-facebook/master
Added option nclient4.WithHWAddr
Diffstat (limited to 'dhcpv4/nclient4/client.go')
-rw-r--r-- | dhcpv4/nclient4/client.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dhcpv4/nclient4/client.go b/dhcpv4/nclient4/client.go index 17af89c..a1596a5 100644 --- a/dhcpv4/nclient4/client.go +++ b/dhcpv4/nclient4/client.go @@ -362,6 +362,15 @@ func WithUnicast(srcAddr *net.UDPAddr) ClientOpt { } } +// WithHWAddr tells to the Client to receive messages destinated to selected +// hardware address +func WithHWAddr(hwAddr net.HardwareAddr) ClientOpt { + return func(c *Client) (err error) { + c.ifaceHWAddr = hwAddr + return + } +} + func withBufferCap(n int) ClientOpt { return func(c *Client) (err error) { c.bufferCap = n |