Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/netinet Pull up from current (approved by thorpej):
details: https://anonhg.NetBSD.org/src/rev/a5a9380d0877
branches: netbsd-1-5
changeset: 489280:a5a9380d0877
user: tron <tron%NetBSD.org@localhost>
date: Sat Aug 26 16:38:32 2000 +0000
description:
Pull up from current (approved by thorpej):
Add new sysctl variables "net.inet.ip.lowportmin" and
"net.inet.ip.lowportmax" which can be used to the set minimum
and maximum port number assigned to sockets using
IP_PORTRANGE_LOW.
syssrc/sys/netinet/in.h 1.49 -> 1.50
syssrc/sys/netinet/in_pcb.c 1.66 -> 1.67
syssrc/sys/netinet/ip_input.c 1.116 -> 1.117
syssrc/sys/netinet/ip_var.h 1.41 -> 1.42
diffstat:
sys/netinet/in.h | 8 ++++++--
sys/netinet/in_pcb.c | 8 +++++---
sys/netinet/ip_input.c | 27 ++++++++++++++++++++++++++-
sys/netinet/ip_var.h | 4 +++-
4 files changed, 40 insertions(+), 7 deletions(-)
diffs (117 lines):
diff -r 97ef9f0c526d -r a5a9380d0877 sys/netinet/in.h
--- a/sys/netinet/in.h Sat Aug 26 13:29:31 2000 +0000
+++ b/sys/netinet/in.h Sat Aug 26 16:38:32 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in.h,v 1.47 2000/03/10 15:30:55 itojun Exp $ */
+/* $NetBSD: in.h,v 1.47.4.1 2000/08/26 16:38:32 tron Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -345,7 +345,9 @@
#define IPCTL_MAXFLOWS 13 /* maximum ip flows allowed */
#define IPCTL_HOSTZEROBROADCAST 14 /* is host zero a broadcast addr? */
#define IPCTL_GIF_TTL 15 /* default TTL for gif encap packet */
-#define IPCTL_MAXID 16
+#define IPCTL_LOWPORTMIN 16 /* minimum reserved port */
+#define IPCTL_LOWPORTMAX 17 /* maximum reserved port */
+#define IPCTL_MAXID 18
#define IPCTL_NAMES { \
{ 0, 0 }, \
@@ -364,6 +366,8 @@
{ "maxflows", CTLTYPE_INT }, \
{ "hostzerobroadcast", CTLTYPE_INT }, \
{ "gifttl", CTLTYPE_INT }, \
+ { "lowportmin", CTLTYPE_INT }, \
+ { "lowportmax", CTLTYPE_INT }, \
}
#endif /* !_XOPEN_SOURCE */
diff -r 97ef9f0c526d -r a5a9380d0877 sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c Sat Aug 26 13:29:31 2000 +0000
+++ b/sys/netinet/in_pcb.c Sat Aug 26 16:38:32 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.c,v 1.65 2000/04/03 03:51:16 enami Exp $ */
+/* $NetBSD: in_pcb.c,v 1.65.4.1 2000/08/26 16:38:32 tron Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,6 +148,8 @@
int anonportmin = IPPORT_ANONMIN;
int anonportmax = IPPORT_ANONMAX;
+int lowportmin = IPPORT_RESERVEDMIN;
+int lowportmax = IPPORT_RESERVEDMAX;
struct pool inpcb_pool;
@@ -288,8 +290,8 @@
if (p == 0 || (error = suser(p->p_ucred, &p->p_acflag)))
return (EACCES);
#endif
- min = IPPORT_RESERVEDMIN;
- max = IPPORT_RESERVEDMAX;
+ min = lowportmin;
+ max = lowportmax;
lastport = &table->inpt_lastlow;
} else {
min = anonportmin;
diff -r 97ef9f0c526d -r a5a9380d0877 sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c Sat Aug 26 13:29:31 2000 +0000
+++ b/sys/netinet/ip_input.c Sat Aug 26 16:38:32 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_input.c,v 1.114 2000/05/10 03:31:30 itojun Exp $ */
+/* $NetBSD: ip_input.c,v 1.114.4.1 2000/08/26 16:38:33 tron Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1715,6 +1715,31 @@
&ip_gif_ttl));
#endif
+#ifndef IPNOPRIVPORTS
+ case IPCTL_LOWPORTMIN:
+ old = lowportmin;
+ error = sysctl_int(oldp, oldlenp, newp, newlen, &lowportmin);
+ if (lowportmin >= lowportmax
+ || lowportmin > IPPORT_RESERVEDMAX
+ || lowportmin < IPPORT_RESERVEDMIN
+ ) {
+ lowportmin = old;
+ return (EINVAL);
+ }
+ return (error);
+ case IPCTL_LOWPORTMAX:
+ old = lowportmax;
+ error = sysctl_int(oldp, oldlenp, newp, newlen, &lowportmax);
+ if (lowportmin >= lowportmax
+ || lowportmax > IPPORT_RESERVEDMAX
+ || lowportmax < IPPORT_RESERVEDMIN
+ ) {
+ lowportmax = old;
+ return (EINVAL);
+ }
+ return (error);
+#endif
+
default:
return (EOPNOTSUPP);
}
diff -r 97ef9f0c526d -r a5a9380d0877 sys/netinet/ip_var.h
--- a/sys/netinet/ip_var.h Sat Aug 26 13:29:31 2000 +0000
+++ b/sys/netinet/ip_var.h Sat Aug 26 16:38:32 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_var.h,v 1.41 2000/03/30 02:37:40 simonb Exp $ */
+/* $NetBSD: ip_var.h,v 1.41.4.1 2000/08/26 16:38:33 tron Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -188,6 +188,8 @@
extern u_int ip_mtudisc_timeout; /* seconds to timeout mtu discovery */
extern int anonportmin; /* minimum ephemeral port */
extern int anonportmax; /* maximum ephemeral port */
+extern int lowportmin; /* minimum reserved port */
+extern int lowportmax; /* maximum reserved port */
extern struct rttimer_queue *ip_mtudisc_timeout_q;
#ifdef GATEWAY
extern int ip_maxflows;
Home |
Main Index |
Thread Index |
Old Index