summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2004-12-06 02:41:43 +0000
committerderaadt <deraadt@openbsd.org>2004-12-06 02:41:43 +0000
commitba5fdea6253f57d5c2483336269f7a334b50b687 (patch)
tree91a65fd407a2e8abe499824109df31671e4076ab
parentPass the proper type for the third argument to cvs_sendreq() (diff)
downloadwireguard-openbsd-ba5fdea6253f57d5c2483336269f7a334b50b687.tar.xz
wireguard-openbsd-ba5fdea6253f57d5c2483336269f7a334b50b687.zip
ipsec udpencap check was done after baddynamicports ports checks (those
tables only map from 512 to 1023 using bitmaps, sorry); ok hshoexer
-rw-r--r--sys/netinet/in_pcb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index ce0e12f31b4..da7458a4426 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.81 2004/11/23 15:35:36 markus Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.82 2004/12/06 02:41:43 deraadt Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -155,17 +155,19 @@ in_baddynamic(port, proto)
u_int16_t proto;
{
- if (port < IPPORT_RESERVED/2 || port >= IPPORT_RESERVED)
- return (0);
switch (proto) {
case IPPROTO_TCP:
+ if (port < IPPORT_RESERVED/2 || port >= IPPORT_RESERVED)
+ return (0);
return (DP_ISSET(baddynamicports.tcp, port));
case IPPROTO_UDP:
#ifdef IPSEC
if (port == udpencap_port)
return (1);
#endif
+ if (port < IPPORT_RESERVED/2 || port >= IPPORT_RESERVED)
+ return (0);
return (DP_ISSET(baddynamicports.udp, port));
default:
return (0);