diff options
author | Chris Koch <chrisko@google.com> | 2019-12-28 03:31:44 -0800 |
---|---|---|
committer | Chris K <c@chrisko.ch> | 2020-03-09 15:38:59 -0700 |
commit | a3af88f6782eba884ef5216b987bf4e2a96ff033 (patch) | |
tree | ae4402ecfd66c1fdcbbf8f3175cb90718de3dc29 /dhcpv6/dhcpv6relay.go | |
parent | 817408d8cc264703a709f21d90ebe62c10a9b87c (diff) |
v6: getter for InterfaceID on RelayOptions
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv6/dhcpv6relay.go')
-rw-r--r-- | dhcpv6/dhcpv6relay.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dhcpv6/dhcpv6relay.go b/dhcpv6/dhcpv6relay.go index 359e6cd..04a3b94 100644 --- a/dhcpv6/dhcpv6relay.go +++ b/dhcpv6/dhcpv6relay.go @@ -30,6 +30,18 @@ func (ro RelayOptions) RelayMessage() DHCPv6 { return nil } +// InterfaceID returns the interface ID of this relay message. +func (ro RelayOptions) InterfaceID() []byte { + opt := ro.Options.GetOne(OptionInterfaceID) + if opt == nil { + return nil + } + if iid, ok := opt.(*optInterfaceID); ok { + return iid.ID + } + return nil +} + // RelayMessage is a DHCPv6 relay agent message as defined by RFC 3315 Section // 7. type RelayMessage struct { |