summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-02-22 21:32:23 +0000
committerpeter <peter@FreeBSD.org>1996-02-22 21:32:23 +0000
commitfe35eac01c2144b50535ae23a00660c11524fd22 (patch)
tree00ca04534534b22254d22056ecd77387d0c0ec90 /sys/netinet/in_pcb.h
parentf7cfae926eb054cccf8e9a58065b4e8a2874d530 (diff)
downloadFreeBSD-src-fe35eac01c2144b50535ae23a00660c11524fd22.zip
FreeBSD-src-fe35eac01c2144b50535ae23a00660c11524fd22.tar.gz
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
Diffstat (limited to 'sys/netinet/in_pcb.h')
-rw-r--r--sys/netinet/in_pcb.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index f6db7bc..bc56f9a 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in_pcb.h 8.1 (Berkeley) 6/10/93
- * $Id: in_pcb.h,v 1.9 1995/11/14 20:34:03 phk Exp $
+ * $Id: in_pcb.h,v 1.10 1995/12/05 21:26:34 bde Exp $
*/
#ifndef _NETINET_IN_PCB_H_
@@ -78,6 +78,8 @@ struct inpcbinfo {
#define INP_RECVDSTADDR 0x04 /* receive IP dst address */
#define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR)
#define INP_HDRINCL 0x08 /* user supplies entire IP header */
+#define INP_HIGHPORT 0x10 /* user wants "high" port binding */
+#define INP_LOWPORT 0x20 /* user wants "low" port binding */
#define INPLOOKUP_WILDCARD 1
OpenPOWER on IntegriCloud