diff options
-rw-r--r-- | dhcpv6/client6/client.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dhcpv6/client6/client.go b/dhcpv6/client6/client.go index 091a58b..9543706 100644 --- a/dhcpv6/client6/client.go +++ b/dhcpv6/client6/client.go @@ -24,6 +24,7 @@ type Client struct { LocalAddr net.Addr RemoteAddr net.Addr SimulateRelay bool + RelayOptions dhcpv6.Options // These options will be added to relay message if SimulateRelay is true } // NewClient returns a Client with default settings @@ -96,6 +97,10 @@ func (c *Client) sendReceive(ifname string, packet dhcpv6.DHCPv6, expectedType d if err != nil { return nil, err } + // Add Relay Options to ecapsulated Packet + for _, opt := range c.RelayOptions { + packet.UpdateOption(opt) + } } if expectedType == dhcpv6.MessageTypeNone { // infer the expected type from the packet being sent |