summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-08-19 05:32:58 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-08-19 05:32:58 +0000
commit11fd7679593910049205ef86f2ad12a554d6c031 (patch)
tree90f40707cc5bbe140af5ff1cc8a17ef0b709401b /usr.sbin
parent27f460e5b026a3e7563c40e207191f2cb0b51217 (diff)
Only print bad dynamic ports list for udp and tcp since that's all
that exist. This fixes a bug where net.inet.ip.redirect, net.inet.ip.directed-broadcast, and net.inet.tcp.keepinittimem got interpreted as dynamic port lists. Oops.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sysctl/sysctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/sysctl/sysctl.c b/usr.sbin/sysctl/sysctl.c
index e87da083671..cfc4b581b04 100644
--- a/usr.sbin/sysctl/sysctl.c
+++ b/usr.sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.15 1997/08/09 23:36:31 millert Exp $ */
+/* $OpenBSD: sysctl.c,v 1.16 1997/08/19 05:32:57 millert Exp $ */
/* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: sysctl.c,v 1.15 1997/08/09 23:36:31 millert Exp $";
+static char *rcsid = "$OpenBSD: sysctl.c,v 1.16 1997/08/19 05:32:57 millert Exp $";
#endif
#endif /* not lint */
@@ -354,8 +354,10 @@ parse(string, flags)
len = sysctl_inet(string, &bufp, mib, flags, &type);
if (len < 0)
return;
- if (mib[3] == TCPCTL_BADDYNAMIC ||
- mib[3] == UDPCTL_BADDYNAMIC) {
+ if ((mib[2] == IPPROTO_TCP &&
+ mib[3] == TCPCTL_BADDYNAMIC) ||
+ (mib[2] == IPPROTO_UDP &&
+ mib[3] == UDPCTL_BADDYNAMIC)) {
u_int32_t newbaddynamic[DP_MAPSIZE];
in_port_t port;