From owner-freebsd-commit Thu Feb 22 13:32:55 1996 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA20691 for freebsd-commit-outgoing; Thu, 22 Feb 1996 13:32:55 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA20679 for cvs-all-outgoing; Thu, 22 Feb 1996 13:32:52 -0800 (PST) Received: (from peter@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA20639 Thu, 22 Feb 1996 13:32:26 -0800 (PST) Date: Thu, 22 Feb 1996 13:32:26 -0800 (PST) From: Peter Wemm Message-Id: <199602222132.NAA20639@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-sys Subject: cvs commit: src/sys/netinet in.h in_pcb.c in_pcb.h ip_output.c Sender: owner-commit@FreeBSD.ORG Precedence: bulk peter 96/02/22 13:32:25 Modified: sys/netinet in.h in_pcb.c in_pcb.h ip_output.c Log: 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 Revision Changes Path 1.15 +48 -14 src/sys/netinet/in.h 1.17 +68 -14 src/sys/netinet/in_pcb.c 1.11 +3 -1 src/sys/netinet/in_pcb.h 1.28 +44 -1 src/sys/netinet/ip_output.c