summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-11-16 14:24:35 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-11-16 14:24:35 +0000
commit3c97fbea5502e1e016d04b03b598bb9ed78910c4 (patch)
tree46afd226b63113de82a739021f42f1e7d3c797e1 /usr.sbin/relayd
parent28176fd1d6565ca69526a633acc6c0687d1343b0 (diff)
Check that http options are only configured in http protocols.
OK benno@
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r--usr.sbin/relayd/parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index 707ed593d9c..791e689aa26 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.217 2017/11/15 19:03:26 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.218 2017/11/16 14:24:34 bluhm Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -1055,6 +1055,11 @@ httpflags_l : httpflags comma httpflags_l
;
httpflags : HEADERLEN NUMBER {
+ if (proto->type != RELAY_PROTO_HTTP) {
+ yyerror("can set http options only for "
+ "http protocol");
+ YYERROR;
+ }
if ($2 < 0 || $2 > RELAY_MAXHEADERLENGTH) {
yyerror("invalid headerlen: %d", $2);
YYERROR;