summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorCedric Berger <cedric@cvs.openbsd.org>2003-01-25 18:16:06 +0000
committerCedric Berger <cedric@cvs.openbsd.org>2003-01-25 18:16:06 +0000
commitb4a0957cc50b6d207f7609fc9c71e7e1819684cc (patch)
tree343f7baac365e8abd7d506400a5ad8df870053d1 /sbin
parentaccd4e24c7444509c99e1466ffffbfd928936bae (diff)
Fix NOACTION with table statements.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y5
-rw-r--r--sbin/pfctl/pfctl_parser.h4
-rw-r--r--sbin/pfctl/pfctl_table.c6
3 files changed, 8 insertions, 7 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 723889a50b2..e953ca4ee9e 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.298 2003/01/25 16:33:19 cedric Exp $ */
+/* $OpenBSD: parse.y,v 1.299 2003/01/25 18:16:05 cedric Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -758,7 +758,8 @@ tabledef : TABLE PORTUNARY STRING PORTUNARY table_opts {
PF_TABLE_NAME_SIZE - 1);
YYERROR;
}
- pfctl_define_table($3, $5.flags, $5.init_addr);
+ pfctl_define_table($3, $5.flags, $5.init_addr,
+ pf->opts & PF_OPT_NOACTION);
}
;
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index edca0ac2be1..39f855a778b 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.h,v 1.42 2003/01/25 16:33:19 cedric Exp $ */
+/* $OpenBSD: pfctl_parser.h,v 1.43 2003/01/25 18:16:05 cedric Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -118,7 +118,7 @@ int eval_pfqueue(struct pfctl *, struct pf_altq *, u_int32_t, u_int16_t);
void pfctl_begin_table(void);
void pfctl_append_addr(char *, int, int);
void pfctl_append_file(char *);
-void pfctl_define_table(char *, int, int);
+void pfctl_define_table(char *, int, int, int);
void pfctl_commit_table(void);
struct icmptypeent {
diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c
index 632ac2cd55a..11268913b32 100644
--- a/sbin/pfctl/pfctl_table.c
+++ b/sbin/pfctl/pfctl_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_table.c,v 1.27 2003/01/25 16:33:19 cedric Exp $ */
+/* $OpenBSD: pfctl_table.c,v 1.28 2003/01/25 18:16:05 cedric Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
@@ -607,12 +607,12 @@ pfctl_append_file(char *file)
}
void
-pfctl_define_table(char *name, int flags, int addrs)
+pfctl_define_table(char *name, int flags, int addrs, int noaction)
{
struct pfr_table tbl;
int rv;
- if ((loadopt & (PFCTL_FLAG_TABLE | PFCTL_FLAG_ALL)) == 0) {
+ if (noaction || (loadopt & (PFCTL_FLAG_TABLE | PFCTL_FLAG_ALL)) == 0) {
size = 0;
return;
}