diff options
-rw-r--r-- | dhcpv6/dhcpv6message.go | 4 | ||||
-rw-r--r-- | dhcpv6/dhcpv6relay.go | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go index 1ea73f7..0cd34f0 100644 --- a/dhcpv6/dhcpv6message.go +++ b/dhcpv6/dhcpv6message.go @@ -280,9 +280,11 @@ func (d *DHCPv6Message) UpdateOption(option Option) { if opt.Code() == option.Code() { d.options[idx] = option // don't look further - break + return } } + // if not found, add it + d.AddOption(option) } func (d *DHCPv6Message) String() string { diff --git a/dhcpv6/dhcpv6relay.go b/dhcpv6/dhcpv6relay.go index 0ccdf72..68f3cf0 100644 --- a/dhcpv6/dhcpv6relay.go +++ b/dhcpv6/dhcpv6relay.go @@ -127,9 +127,11 @@ func (r *DHCPv6Relay) UpdateOption(option Option) { if opt.Code() == option.Code() { r.options[idx] = option // don't look further - break + return } } + // if not found, add it + r.AddOption(option) } func (r *DHCPv6Relay) IsRelay() bool { |