summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sasyncd
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2019-03-21 10:55:41 +0000
committerotto <otto@openbsd.org>2019-03-21 10:55:41 +0000
commit9cfbef9b34e829ed5250c0e67f4f945ef3330192 (patch)
tree7d47a72f1c8c357d20b5832dfd4522bd8bc5d54a /usr.sbin/sasyncd
parentpunctuation needs to be preceeded by a space, in Scots; (diff)
downloadwireguard-openbsd-9cfbef9b34e829ed5250c0e67f4f945ef3330192.tar.xz
wireguard-openbsd-9cfbef9b34e829ed5250c0e67f4f945ef3330192.zip
Fix IPv6 address parsing and skipping of comment lines followed by blank
lines; Found while investigating a diff from Michal Koc; ok kn@
Diffstat (limited to 'usr.sbin/sasyncd')
-rw-r--r--usr.sbin/sasyncd/conf.y7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/sasyncd/conf.y b/usr.sbin/sasyncd/conf.y
index 868063c1f5b..0b6731c19b5 100644
--- a/usr.sbin/sasyncd/conf.y
+++ b/usr.sbin/sasyncd/conf.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.y,v 1.19 2017/04/09 02:40:24 jsg Exp $ */
+/* $OpenBSD: conf.y,v 1.20 2019/03/21 10:55:41 otto Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -325,7 +325,7 @@ yylex(void)
/* Numerical token? */
if (isdigit(*confptr)) {
for (p = confptr; *p; p++)
- if (*p == '.') /* IP address, or bad input */
+ if (*p == '.' || *p == ':') /* IP address, or bad input */
goto is_string;
v = (int)strtol(confptr, (char **)NULL, 10);
yylval.val = v;
@@ -397,6 +397,9 @@ conf_parse_file(char *cfgfile)
if (*s == '#') {
while (*s != '\n' && s < buf + conflen)
s++;
+ while (*s == '\n' && s < buf + conflen)
+ s++;
+ s--;
continue;
}
if (d == buf && isspace(*s))