summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/dhcpv6relay.go
diff options
context:
space:
mode:
authorinsomniac <insomniacslk@users.noreply.github.com>2018-05-02 00:57:57 +0200
committerGitHub <noreply@github.com>2018-05-02 00:57:57 +0200
commit08a6a496134a077cb868adb516c602fa12bb9b1e (patch)
treeb8ddabacacd29bf3523e770973785577fd4890d5 /dhcpv6/dhcpv6relay.go
parent18dae087d822c843c2a2252f915f45577ba21df8 (diff)
UpdateOption now adds the option if missing (#55)
Diffstat (limited to 'dhcpv6/dhcpv6relay.go')
-rw-r--r--dhcpv6/dhcpv6relay.go4
1 files changed, 3 insertions, 1 deletions
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 {