summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/dhcpv6message.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/dhcpv6message.go')
-rw-r--r--dhcpv6/dhcpv6message.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go
index 28853f1..400c46a 100644
--- a/dhcpv6/dhcpv6message.go
+++ b/dhcpv6/dhcpv6message.go
@@ -92,6 +92,18 @@ func (mo MessageOptions) RequestedOptions() OptionCodes {
return oro.OptionCodes
}
+// DNS returns the DNS Recursive Name Server option as defined by RFC 3646.
+func (mo MessageOptions) DNS() []net.IP {
+ opt := mo.Options.GetOne(OptionDNSRecursiveNameServer)
+ if opt == nil {
+ return nil
+ }
+ if dns, ok := opt.(*optDNS); ok {
+ return dns.NameServers
+ }
+ return nil
+}
+
// Message represents a DHCPv6 Message as defined by RFC 3315 Section 6.
type Message struct {
MessageType MessageType