HardenedBSD/sys/netinet
Peter Wemm 33b3ac0633 Make the default behavior of local port assignment match traditional
systems (my last change did not mix well with some firewall
configurations).  As much as I dislike firewalls, this is one thing I
I was not prepared to break by default.. :-)

Allow the user to nominate one of three ranges of port numbers as
candidates for selecting a local address to replace a zero port number.
The ranges are selected via a setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &arg)
call.  The three ranges are: default, high (to bypass firewalls) and
low (to get a port below 1024).

The default and high port ranges are sysctl settable under sysctl
net.inet.ip.portrange.*

This code also fixes a potential deadlock if the system accidently ran out
of local port addresses. It'd drop into an infinite while loop.

The secure port selection (for root) should reduce overheads and increase
reliability of rlogin/rlogind/rsh/rshd if they are modified to take
advantage of it.

Partly suggested by: pst
Reviewed by: wollman
1996-02-22 21:32:23 +00:00
..
icmp_var.h
if_ether.c Make the "arpresolve: can't allocate llinfo" error message 1996-02-20 17:54:17 +00:00
if_ether.h
if_fddi.h
igmp_var.h Fix a bunch of spelling errors in the comment fields of 1996-01-30 23:02:38 +00:00
igmp.c
igmp.h
in_cksum.c
in_pcb.c Make the default behavior of local port assignment match traditional 1996-02-22 21:32:23 +00:00
in_pcb.h Make the default behavior of local port assignment match traditional 1996-02-22 21:32:23 +00:00
in_proto.c #if out unsupported IMP code. 1996-02-08 15:43:35 +00:00
in_rmx.c
in_systm.h
in_var.h Provide a direct entry point for IP input. This actually results 1996-02-05 20:36:02 +00:00
in.c
in.h Make the default behavior of local port assignment match traditional 1996-02-22 21:32:23 +00:00
ip_fw.c Make the sorting of IPFW rules an option. You don't want it to sort them. 1996-02-03 11:48:12 +00:00
ip_fw.h
ip_fwdef.c
ip_icmp.c
ip_icmp.h Fix a bunch of spelling errors in the comment fields of 1996-01-30 23:02:38 +00:00
ip_input.c Provide a direct entry point for IP input. This actually results 1996-02-05 20:36:02 +00:00
ip_mroute.c
ip_mroute.h
ip_output.c Make the default behavior of local port assignment match traditional 1996-02-22 21:32:23 +00:00
ip_var.h Fix a bunch of spelling errors in the comment fields of 1996-01-30 23:02:38 +00:00
ip.h
raw_ip.c
tcp_debug.c
tcp_debug.h
tcp_fsm.h
tcp_input.c Fixed bug in Path MTU Discovery that caused the system to have to re- 1996-02-22 11:46:39 +00:00
tcp_output.c
tcp_reass.c Fixed bug in Path MTU Discovery that caused the system to have to re- 1996-02-22 11:46:39 +00:00
tcp_seq.h
tcp_subr.c
tcp_timer.c
tcp_timer.h Fix a bunch of spelling errors in the comment fields of 1996-01-30 23:02:38 +00:00
tcp_timewait.c
tcp_usrreq.c
tcp_var.h Fix a bunch of spelling errors in the comment fields of 1996-01-30 23:02:38 +00:00
tcp.h
tcpip.h
udp_usrreq.c
udp_var.h
udp.h