Places where policy doesn't belong...
A former boss asked on a mailing list if anyone knew how various OSes chose their source ports for TCP and UDP connections. we got answers. i decided to look at the code and supply an answer for linux 2.4.18 and found the following default source port ranges:
If the system has >=128mb of ram: 32768-61000 If the system has 64-127mb of ram: 1024-4999 If the system has 32-63mb of ram: 2048-4999 If the system has <32mb ram: 3072-4999
Sigh. Why? This is a policy decision. If someone has a system with low memory and thinks that this will actually make a difference to their system: Run sysctl in a startup script! sheesh.
Note also that the IANA standard for source ports says to pick a number between 49152 - 65535.
Maybe I'll write up a patch, post it and be laughed at. Or maybe i'll be lazy...