summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-08-14 20:41:40 +0100
committerPablo Mazzini <pmazzini@gmail.com>2018-08-14 20:41:40 +0100
commitbba4e7b231aa872aa1fde81fdd55f7d57987f082 (patch)
tree936531f46865716d85c53427b170202cbcf742f7
parente14f9e09d34be98fddb8686af726d7e6692f2e3b (diff)
NewRelayReplFromRelayForw: add remoteid
-rw-r--r--dhcpv6/dhcpv6relay.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/dhcpv6/dhcpv6relay.go b/dhcpv6/dhcpv6relay.go
index d9555cb..f7125b1 100644
--- a/dhcpv6/dhcpv6relay.go
+++ b/dhcpv6/dhcpv6relay.go
@@ -165,6 +165,7 @@ func NewRelayReplFromRelayForw(relayForw, msg DHCPv6) (DHCPv6, error) {
err error
linkAddr, peerAddr []net.IP
optiids []Option
+ optrid []Option
)
if relayForw == nil {
return nil, errors.New("RELAY_FORW cannot be nil")
@@ -186,6 +187,7 @@ func NewRelayReplFromRelayForw(relayForw, msg DHCPv6) (DHCPv6, error) {
linkAddr = append(linkAddr, relay.LinkAddr())
peerAddr = append(peerAddr, relay.PeerAddr())
optiids = append(optiids, relay.GetOneOption(OptionInterfaceID))
+ optrid = append(optrid, relay.GetOneOption(OptionRemoteID))
decap, err := DecapsulateRelay(relay)
if err != nil {
return nil, err
@@ -201,6 +203,9 @@ func NewRelayReplFromRelayForw(relayForw, msg DHCPv6) (DHCPv6, error) {
if opt := optiids[i]; opt != nil {
msg.AddOption(opt)
}
+ if opt := optrid[i]; opt != nil {
+ msg.AddOption(opt)
+ }
if err != nil {
return nil, err
}