-/* $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 <reyk@openbsd.org>
#include <sys/uio.h>
#include <net/if.h>
-#include <net/pfvar.h>
#include <netinet/in.h>
#include <net/route.h>
-/* $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 <reyk@openbsd.org>
#include <sys/ioctl.h>
#include <net/if.h>
-#include <net/pfvar.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/route.h>
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) {
}
;
-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;
}
;