diff options
author | Jakob Borg <jakob@kastelo.net> | 2024-04-11 13:23:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-11 13:23:29 +0200 |
commit | 79ae24df7688c37a7a897218c87bff412a887b9d (patch) | |
tree | 8b62e7215fb486718897992cfcc48059819f289f | |
parent | 61b94b9ea51d2591145e07361f2a1816a480b6bf (diff) |
lib/nat: Don't crash on empty address list (fixes #9503) (#9504)
-rw-r--r-- | lib/nat/service.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/nat/service.go b/lib/nat/service.go index 8ff66a3807..d0644c3199 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 |