diff --git a/firewall/firewall_windows.go b/firewall/firewall_windows.go index 8d2e1362..d913ab31 100644 --- a/firewall/firewall_windows.go +++ b/firewall/firewall_windows.go @@ -77,9 +77,9 @@ func (f *WindowsFirewall) AllowPort(port int, address string, proto string, allo cmd := []string{"advfirewall"} if allow { - cmd = append(cmd, []string{"add", "rule", nameField, protoField, "dir=in", ipField, portField, "action=allow"}) + cmd = append(cmd, []string{"add", "rule", nameField, protoField, "dir=in", ipField, portField, "action=allow"}...) } else { - cmd = append(cmd, []string{"del", "rule", nameField}) + cmd = append(cmd, []string{"del", "rule", nameField}...) } out, err := core.Exec("netsh", cmd)