diff options
author | 2015-01-29 08:52:52 +0000 | |
---|---|---|
committer | 2015-01-29 08:52:52 +0000 | |
commit | 551bd022e7c3ecd4fe58fa045a778dcf51f5e176 (patch) | |
tree | 93933c25489d3fc8b42da814aeac52e6b07e599c | |
parent | manual SAs described in ipsec.conf(5) not ipsecctl(8); (diff) | |
download | wireguard-openbsd-551bd022e7c3ecd4fe58fa045a778dcf51f5e176.tar.xz wireguard-openbsd-551bd022e7c3ecd4fe58fa045a778dcf51f5e176.zip |
Fix a regression that removed support for using service names instead
of ports. It is now possible to use "listen on * port www" again.
Found by ajacoutot@
OK ajacoutot@ blambert@
-rw-r--r-- | usr.sbin/httpd/parse.y | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y index 4a037c7c663..d613efd9f94 100644 --- a/usr.sbin/httpd/parse.y +++ b/usr.sbin/httpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.58 2015/01/21 22:21:05 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.59 2015/01/29 08:52:52 reyk Exp $ */ /* * Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org> @@ -903,6 +903,18 @@ port : PORT NUMBER { } $$.val[0] = htons($2); } + | PORT STRING { + int val; + + if ((val = getservice($2)) == -1) { + yyerror("invalid port: %s", $2); + free($2); + YYERROR; + } + free($2); + + $$.val[0] = val; + } ; timeout : NUMBER |