From ea25a0ff89b716c4ab7dd79c631b554828c65f9d Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 20 Sep 2023 09:51:13 +0000 Subject: [PATCH] fix(protonvpn): natpmp assigned ports logs removed --- internal/provider/protonvpn/portforward.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/internal/provider/protonvpn/portforward.go b/internal/provider/protonvpn/portforward.go index fe21e7bd0..6b89d3e5f 100644 --- a/internal/provider/protonvpn/portforward.go +++ b/internal/provider/protonvpn/portforward.go @@ -36,7 +36,7 @@ func (p *Provider) PortForward(ctx context.Context, _ *http.Client, const internalPort, externalPort = 0, 0 const lifetime = 60 * time.Second for _, networkProtocol := range networkProtocols { - _, assignedInternalPort, assignedExternalPort, assignedLiftetime, err := + _, _, assignedExternalPort, assignedLiftetime, err := client.AddPortMapping(ctx, gateway, networkProtocol, internalPort, externalPort, lifetime) if err != nil { @@ -49,12 +49,6 @@ func (p *Provider) PortForward(ctx context.Context, _ *http.Client, assignedLiftetime, lifetime)) } - if assignedInternalPort != internalPort { - logger.Warn(fmt.Sprintf("internal port assigned %d differs"+ - " from internal port requested %d", - assignedInternalPort, internalPort)) - } - port = assignedExternalPort } @@ -78,7 +72,7 @@ func (p *Provider) KeepPortForward(ctx context.Context, port uint16, const lifetime = 60 * time.Second for _, networkProtocol := range networkProtocols { - _, assignedInternalPort, assignedExternalPort, assignedLiftetime, err := + _, _, assignedExternalPort, assignedLiftetime, err := client.AddPortMapping(ctx, gateway, networkProtocol, internalPort, port, lifetime) if err != nil { @@ -91,10 +85,10 @@ func (p *Provider) KeepPortForward(ctx context.Context, port uint16, assignedLiftetime, lifetime)) } - if assignedInternalPort != assignedExternalPort { - logger.Warn(fmt.Sprintf("internal port assigned %d differs"+ - " from external port assigned %d", - assignedInternalPort, assignedExternalPort)) + if port != assignedExternalPort { + logger.Warn(fmt.Sprintf("external port assigned %d changed to %d", + port, assignedExternalPort)) + port = assignedExternalPort } }