aboutsummaryrefslogtreecommitdiff
path: root/lib/nat/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nat/service.go')
-rw-r--r--lib/nat/service.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/nat/service.go b/lib/nat/service.go
index 8ff66a380..d0644c319 100644
--- a/lib/nat/service.go
+++ b/lib/nat/service.go
@@ -233,9 +233,8 @@ func (s *Service) verifyExistingLocked(ctx context.Context, mapping *Mapping, na
default:
}
- // Delete addresses for NATDevice's that do not exist anymore
- nat, ok := nats[id]
- if !ok {
+ if nat, ok := nats[id]; !ok || len(extAddrs) == 0 {
+ // Delete addresses for NATDevice's that do not exist anymore
mapping.removeAddressLocked(id)
change = true
continue