summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/client6
diff options
context:
space:
mode:
authorAkshay Navale <akna8887@colorado.edu>2019-05-09 03:07:33 -0600
committerPablo Mazzini <pmazzini@gmail.com>2019-05-09 10:07:33 +0100
commit15b76eb439c6abab393a9f129239623642e10444 (patch)
tree4de44c35cdb96f6f8053622e4ef23f038604e902 /dhcpv6/client6
parentb743592c9784d62cbadcabab89f81b7914393918 (diff)
Adding RemoteID option while creating a Relayed Encapsulated Packet (#282)
Diffstat (limited to 'dhcpv6/client6')
-rw-r--r--dhcpv6/client6/client.go5
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