Skip to content

Commit

Permalink
updated ports as in dotnet#5380
Browse files Browse the repository at this point in the history
  • Loading branch information
vlada-shubina committed Nov 4, 2022
1 parent 2fbe5b7 commit 3b08298
Showing 1 changed file with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,31 @@ internal class GeneratePortNumberConfig : BaseMacroConfig<GeneratePortNumberMacr
internal const int LowPortDefault = 1024;
internal const int HighPortDefault = 65535;

private static readonly HashSet<int> UnsafePorts = new()
// sources of unsafe ports:
// * chrome: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc#27
// * firefox: https://www-archive.mozilla.org/projects/netlib/portbanning#portlist
// * safari: https://github.com/WebKit/WebKit/blob/42f5a93823a7f087a800cd65c6bc0551dbeb55d3/Source/WTF/wtf/URL.cpp#L969
private static readonly HashSet<int> UnsafePorts = new HashSet<int>()
{
2049, // nfs
3659, // apple-sasl / PasswordServer
4045, // lockd
6000, // X11
6665, // Alternate IRC [Apple addition]
6666, // Alternate IRC [Apple addition]
6667, // Standard IRC [Apple addition]
6668, // Alternate IRC [Apple addition]
6669, // Alternate IRC [Apple addition]
1719, // H323 (RAS)
1720, // H323 (Q931)
1723, // H323 (H245)
2049, // NFS
3659, // apple-sasl / PasswordServer [Apple addition]
4045, // lockd
4190, // ManageSieve [Apple addition]
5060, // SIP
5061, // SIPS
6000, // X11
6566, // SANE
6665, // Alternate IRC [Apple addition]
6666, // Alternate IRC [Apple addition]
6667, // Standard IRC [Apple addition]
6668, // Alternate IRC [Apple addition]
6669, // Alternate IRC [Apple addition]
6679, // Alternate IRC SSL [Apple addition]
6697, // IRC+SSL [Apple addition]
10080, // amanda
};

internal GeneratePortNumberConfig(GeneratePortNumberMacro macro, string variableName, string? dataType, int fallback, int low, int high)
Expand Down

0 comments on commit 3b08298

Please sign in to comment.