summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sasyncd
diff options
context:
space:
mode:
authorgsoares <gsoares@openbsd.org>2012-12-21 13:53:01 +0000
committergsoares <gsoares@openbsd.org>2012-12-21 13:53:01 +0000
commit4ed50b747199d261b3c9f66b8d33d289b8de97c2 (patch)
tree1617f1d9f1925b89dad927a36011bc6d0ed0576a /usr.sbin/sasyncd
parentRather than calling mircotime in bpf_catchpacket each time it's called (diff)
downloadwireguard-openbsd-4ed50b747199d261b3c9f66b8d33d289b8de97c2.tar.xz
wireguard-openbsd-4ed50b747199d261b3c9f66b8d33d289b8de97c2.zip
valid port interval 1 through 65535, not 1 - 65534
check interval with yacc/$5 variable instead of cfgstate.listen_port that is an in_port_t type, for avoid warnings, due to limited range of data type; use IPPORT_HILASTAUTO for more consistence (input from millert@) "yeah, I like that. ok" henning@
Diffstat (limited to 'usr.sbin/sasyncd')
-rw-r--r--usr.sbin/sasyncd/conf.y5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/sasyncd/conf.y b/usr.sbin/sasyncd/conf.y
index 6950a20f495..fb3a0b2b365 100644
--- a/usr.sbin/sasyncd/conf.y
+++ b/usr.sbin/sasyncd/conf.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.y,v 1.16 2012/04/14 11:46:09 haesbaert Exp $ */
+/* $OpenBSD: conf.y,v 1.17 2012/12/21 13:53:01 gsoares Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -205,8 +205,7 @@ setting : INTERFACE STRING
cfgstate.listen_on = $3;
cfgstate.listen_family = $4;
cfgstate.listen_port = $5;
- if (cfgstate.listen_port < 1 ||
- cfgstate.listen_port > 65534) {
+ if ($5 < 1 || $5 > IPPORT_HILASTAUTO) {
cfgstate.listen_port = SASYNCD_DEFAULT_PORT;
log_msg(0, "config: bad port, listen-port "
"reset to %u", SASYNCD_DEFAULT_PORT);