summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/modifiers.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/modifiers.go')
-rw-r--r--dhcpv6/modifiers.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/dhcpv6/modifiers.go b/dhcpv6/modifiers.go
index eaa370d..200a602 100644
--- a/dhcpv6/modifiers.go
+++ b/dhcpv6/modifiers.go
@@ -77,6 +77,21 @@ func WithIANA(addrs ...OptIAAddress) Modifier {
}
}
+// WithIAID updates an OptIANA option with the provided IAID
+func WithIAID(iaid [4]byte) Modifier {
+ return func(d DHCPv6) {
+ opt := d.GetOneOption(OptionIANA)
+ if opt == nil {
+ opt = &OptIANA{
+ Options: Options{},
+ }
+ }
+ iaNa := opt.(*OptIANA)
+ copy(iaNa.IaId[:], iaid[:])
+ d.UpdateOption(iaNa)
+ }
+}
+
// WithDNS adds or updates an OptDNSRecursiveNameServer
func WithDNS(dnses ...net.IP) Modifier {
return func(d DHCPv6) {