Port forwarded firewall fix
This commit is contained in:
@@ -87,12 +87,14 @@ func (c *configurator) SetPortForward(ctx context.Context, port uint16) (err err
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tun = string(constants.TUN)
|
const tun = string(constants.TUN)
|
||||||
|
if c.portForwarded > 0 {
|
||||||
if err := c.acceptInputToPort(ctx, tun, constants.TCP, c.portForwarded, true); err != nil {
|
if err := c.acceptInputToPort(ctx, tun, constants.TCP, c.portForwarded, true); err != nil {
|
||||||
return fmt.Errorf("cannot remove outdated port forward rule from firewall: %w", err)
|
return fmt.Errorf("cannot remove outdated port forward rule from firewall: %w", err)
|
||||||
}
|
}
|
||||||
if err := c.acceptInputToPort(ctx, tun, constants.UDP, c.portForwarded, true); err != nil {
|
if err := c.acceptInputToPort(ctx, tun, constants.UDP, c.portForwarded, true); err != nil {
|
||||||
return fmt.Errorf("cannot remove outdated port forward rule from firewall: %w", err)
|
return fmt.Errorf("cannot remove outdated port forward rule from firewall: %w", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if port == 0 { // not changing port
|
if port == 0 { // not changing port
|
||||||
c.portForwarded = 0
|
c.portForwarded = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user