diff --git a/internal/portforward/service/service.go b/internal/portforward/service/service.go index 75b1972f9..76d3b47a4 100644 --- a/internal/portforward/service/service.go +++ b/internal/portforward/service/service.go @@ -52,7 +52,7 @@ func (s *Service) SetPortsForwarded(ctx context.Context, ports []uint16) (err er for i, port := range s.ports { err := s.portAllower.RemoveAllowedPort(ctx, port) if err != nil { - for j := 0; j < i; j++ { + for j := range i { _ = s.portAllower.SetAllowedPort(ctx, s.ports[j], s.settings.Interface) } s.logger.Error(err.Error())