falahati / WindowsFirewallHelper

A class library to manage the Windows Firewall as well as adding your program to the Windows Firewall Exception list.
MIT License
276 stars 72 forks source link

Wrong condition when checking if port in FirewallAPIv2 is UDP #19

Closed jfevia closed 5 years ago

jfevia commented 5 years ago

https://github.com/falahati/WindowsFirewallHelper/blob/e17c78a84130f6f5c1c5a3c0a4d3fe712a597965/WindowsFirewallHelper/FirewallAPIv2/Firewall.cs#L137

This condition throws an exception if the protocol is not TCP and is UDP.

I believe the right condition is not TCP and not UDP.

falahati commented 5 years ago

True, thanks for reporting this. It seems that I missed a ! there.

falahati commented 5 years ago

Should be fixed with the latest release.