@@ -15,17 +15,31 @@ internal class GeneratePortNumberConfig : BaseMacroConfig<GeneratePortNumberMacr
1515 internal const int LowPortDefault = 1024 ;
1616 internal const int HighPortDefault = 65535 ;
1717
18- private static readonly HashSet < int > UnsafePorts = new ( )
18+ // sources of unsafe ports:
19+ // * chrome: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc#27
20+ // * firefox: https://www-archive.mozilla.org/projects/netlib/portbanning#portlist
21+ // * safari: https://github.com/WebKit/WebKit/blob/42f5a93823a7f087a800cd65c6bc0551dbeb55d3/Source/WTF/wtf/URL.cpp#L969
22+ private static readonly HashSet < int > UnsafePorts = new HashSet < int > ( )
1923 {
20- 2049 , // nfs
21- 3659 , // apple-sasl / PasswordServer
22- 4045 , // lockd
23- 6000 , // X11
24- 6665 , // Alternate IRC [Apple addition]
25- 6666 , // Alternate IRC [Apple addition]
26- 6667 , // Standard IRC [Apple addition]
27- 6668 , // Alternate IRC [Apple addition]
28- 6669 , // Alternate IRC [Apple addition]
24+ 1719 , // H323 (RAS)
25+ 1720 , // H323 (Q931)
26+ 1723 , // H323 (H245)
27+ 2049 , // NFS
28+ 3659 , // apple-sasl / PasswordServer [Apple addition]
29+ 4045 , // lockd
30+ 4190 , // ManageSieve [Apple addition]
31+ 5060 , // SIP
32+ 5061 , // SIPS
33+ 6000 , // X11
34+ 6566 , // SANE
35+ 6665 , // Alternate IRC [Apple addition]
36+ 6666 , // Alternate IRC [Apple addition]
37+ 6667 , // Standard IRC [Apple addition]
38+ 6668 , // Alternate IRC [Apple addition]
39+ 6669 , // Alternate IRC [Apple addition]
40+ 6679 , // Alternate IRC SSL [Apple addition]
41+ 6697 , // IRC+SSL [Apple addition]
42+ 10080 , // amanda
2943 } ;
3044
3145 internal GeneratePortNumberConfig ( GeneratePortNumberMacro macro , string variableName , string ? dataType , int fallback , int low , int high )
0 commit comments