fix(protonvpn): natpmp assigned ports logs removed
This commit is contained in:
@@ -36,7 +36,7 @@ func (p *Provider) PortForward(ctx context.Context, _ *http.Client,
|
|||||||
const internalPort, externalPort = 0, 0
|
const internalPort, externalPort = 0, 0
|
||||||
const lifetime = 60 * time.Second
|
const lifetime = 60 * time.Second
|
||||||
for _, networkProtocol := range networkProtocols {
|
for _, networkProtocol := range networkProtocols {
|
||||||
_, assignedInternalPort, assignedExternalPort, assignedLiftetime, err :=
|
_, _, assignedExternalPort, assignedLiftetime, err :=
|
||||||
client.AddPortMapping(ctx, gateway, networkProtocol,
|
client.AddPortMapping(ctx, gateway, networkProtocol,
|
||||||
internalPort, externalPort, lifetime)
|
internalPort, externalPort, lifetime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -49,12 +49,6 @@ func (p *Provider) PortForward(ctx context.Context, _ *http.Client,
|
|||||||
assignedLiftetime, lifetime))
|
assignedLiftetime, lifetime))
|
||||||
}
|
}
|
||||||
|
|
||||||
if assignedInternalPort != internalPort {
|
|
||||||
logger.Warn(fmt.Sprintf("internal port assigned %d differs"+
|
|
||||||
" from internal port requested %d",
|
|
||||||
assignedInternalPort, internalPort))
|
|
||||||
}
|
|
||||||
|
|
||||||
port = assignedExternalPort
|
port = assignedExternalPort
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +72,7 @@ func (p *Provider) KeepPortForward(ctx context.Context, port uint16,
|
|||||||
const lifetime = 60 * time.Second
|
const lifetime = 60 * time.Second
|
||||||
|
|
||||||
for _, networkProtocol := range networkProtocols {
|
for _, networkProtocol := range networkProtocols {
|
||||||
_, assignedInternalPort, assignedExternalPort, assignedLiftetime, err :=
|
_, _, assignedExternalPort, assignedLiftetime, err :=
|
||||||
client.AddPortMapping(ctx, gateway, networkProtocol,
|
client.AddPortMapping(ctx, gateway, networkProtocol,
|
||||||
internalPort, port, lifetime)
|
internalPort, port, lifetime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -91,10 +85,10 @@ func (p *Provider) KeepPortForward(ctx context.Context, port uint16,
|
|||||||
assignedLiftetime, lifetime))
|
assignedLiftetime, lifetime))
|
||||||
}
|
}
|
||||||
|
|
||||||
if assignedInternalPort != assignedExternalPort {
|
if port != assignedExternalPort {
|
||||||
logger.Warn(fmt.Sprintf("internal port assigned %d differs"+
|
logger.Warn(fmt.Sprintf("external port assigned %d changed to %d",
|
||||||
" from external port assigned %d",
|
port, assignedExternalPort))
|
||||||
assignedInternalPort, assignedExternalPort))
|
port = assignedExternalPort
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user