From bba4e7b231aa872aa1fde81fdd55f7d57987f082 Mon Sep 17 00:00:00 2001 From: Pablo Mazzini Date: Tue, 14 Aug 2018 20:41:40 +0100 Subject: NewRelayReplFromRelayForw: add remoteid --- dhcpv6/dhcpv6relay.go | 5 +++++ 1 file changed, 5 insertions(+) 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 } -- cgit v1.2.3