summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/dhcpv6relay.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/dhcpv6relay.go')
-rw-r--r--dhcpv6/dhcpv6relay.go30
1 files changed, 2 insertions, 28 deletions
diff --git a/dhcpv6/dhcpv6relay.go b/dhcpv6/dhcpv6relay.go
index 2387212..eaebfc2 100644
--- a/dhcpv6/dhcpv6relay.go
+++ b/dhcpv6/dhcpv6relay.go
@@ -151,39 +151,13 @@ func (d *DHCPv6Relay) GetInnerMessage() (DHCPv6, error) {
if !p.IsRelay() {
return p, nil
}
- p, err = DecapsulateRelay(p)
+ p, err = DecapsulateRelay(p, 0)
if err != nil {
return nil, err
}
}
}
-// GetInnerRelay recurses into a relay message and extract and return the inner
-// DHCPv6Relay. Return nil if none found (e.g. not a relay message).
-func (r *DHCPv6Relay) GetInnerRelay() (DHCPv6, error) {
- p := r
- for {
- d, err := DecapsulateRelay(p)
- if err != nil {
- return nil, err
- }
- if !d.IsRelay() {
- return p, nil
- }
- p = d.(*DHCPv6Relay)
- }
-}
-
-// GetInnerPeerAddr returns the peer address in the inner most relay info
-// header, this is typically the IP address of the client making the request.
-func (r *DHCPv6Relay) GetInnerPeerAddr() (net.IP, error) {
- p, err := r.GetInnerRelay()
- if err != nil {
- return nil, err
- }
- return p.(*DHCPv6Relay).PeerAddr(), nil
-}
-
// NewRelayReplFromRelayForw creates a RELAY_REPL packet based on a RELAY_FORW
// packet and replaces the inner message with the passed DHCPv6 message.
func NewRelayReplFromRelayForw(relayForw, msg DHCPv6) (DHCPv6, error) {
@@ -212,7 +186,7 @@ func NewRelayReplFromRelayForw(relayForw, msg DHCPv6) (DHCPv6, error) {
linkAddr = append(linkAddr, relay.LinkAddr())
peerAddr = append(peerAddr, relay.PeerAddr())
optiids = append(optiids, relay.GetOneOption(OPTION_INTERFACE_ID))
- decap, err := DecapsulateRelay(relay)
+ decap, err := DecapsulateRelay(relay, 0)
if err != nil {
return nil, err
}