From 85deb9998dc1641be9bdd1eff20deb01a60b94d8 Mon Sep 17 00:00:00 2001 From: reyk Date: Mon, 19 Jan 2015 21:07:33 +0000 Subject: [PATCH] No need to include pfvar.h, another leftover from relayd. It was also used for portrange operators which weren't used in httpd. OK florian@ --- usr.sbin/httpd/config.c | 3 +-- usr.sbin/httpd/parse.y | 37 ++----------------------------------- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/usr.sbin/httpd/config.c b/usr.sbin/httpd/config.c index 07d8e3287ac..98e06b58514 100644 --- a/usr.sbin/httpd/config.c +++ b/usr.sbin/httpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.30 2015/01/19 19:37:50 reyk Exp $ */ +/* $OpenBSD: config.c,v 1.31 2015/01/19 21:07:33 reyk Exp $ */ /* * Copyright (c) 2011 - 2015 Reyk Floeter @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y index 1b489401070..1c2c90ca121 100644 --- a/usr.sbin/httpd/parse.y +++ b/usr.sbin/httpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.56 2015/01/19 19:37:50 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.57 2015/01/19 21:07:33 reyk Exp $ */ /* * Copyright (c) 2007 - 2015 Reyk Floeter @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -369,11 +368,6 @@ serveroptsl : LISTEN ON STRING opttls port { s_conf = alias; } else s_conf = &srv->srv_conf; - if ($5.op != PF_OP_EQ) { - yyerror("invalid port"); - free($3); - YYERROR; - } TAILQ_INIT(&al); if (host($3, &al, 1, &$5, NULL, -1) <= 0) { @@ -901,39 +895,12 @@ medianamesl : numberstring { } ; -port : PORT STRING { - char *a, *b; - int p[2]; - - p[0] = p[1] = 0; - - a = $2; - b = strchr($2, ':'); - if (b == NULL) - $$.op = PF_OP_EQ; - else { - *b++ = '\0'; - if ((p[1] = getservice(b)) == -1) { - free($2); - YYERROR; - } - $$.op = PF_OP_RRG; - } - if ((p[0] = getservice(a)) == -1) { - free($2); - YYERROR; - } - $$.val[0] = p[0]; - $$.val[1] = p[1]; - free($2); - } - | PORT NUMBER { +port : PORT NUMBER { if ($2 <= 0 || $2 >= (int)USHRT_MAX) { yyerror("invalid port: %lld", $2); YYERROR; } $$.val[0] = htons($2); - $$.op = PF_OP_EQ; } ; -- 2.20.1