summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>1999-11-10 13:07:18 +0000
committerPavel Machek <pavel@ucw.cz>1999-11-10 13:07:18 +0000
commit2f702671b46fa2ea01021170f685f554e4012782 (patch)
treea0f45ab50cc9424642d890f19a69116c29408f1d /filter
parent4995564570f9779686f767ec98034ce58d836203 (diff)
No more shift/reduce conflicts.
Diffstat (limited to 'filter')
-rw-r--r--filter/config.Y2
-rw-r--r--filter/filter.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/filter/config.Y b/filter/config.Y
index b410397b..8f41f443 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -235,7 +235,7 @@ constant:
| TEXT { $$ = f_new_inst(); $$->code = 'c'; $$->a1.i = T_STRING; $$->a2.p = $1; }
| pair { $$ = f_new_inst(); $$->code = 'c'; $$->a1.i = T_PAIR; $$->a2.i = $1; }
| ipa { NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; $$->a1.p = val; *val = $1; }
- | prefix {NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; $$->a1.p = val; *val = $1; }
+ | prefix_s {NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; $$->a1.p = val; *val = $1; }
| '[' set_items ']' { printf( "We've got a set here..." ); $$ = f_new_inst(); $$->code = 'c'; $$->a1.i = T_SET; $$->a2.p = build_tree($2); printf( "ook\n" ); }
;
diff --git a/filter/filter.c b/filter/filter.c
index a6030ae7..0dc4b213 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -6,6 +6,8 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*
* Notice that pair is stored as integer: first << 16 | second
+ *
+ * FIXME: Check if prefixes are really prefixes.
*/
#include <stdio.h>
@@ -111,7 +113,7 @@ val_in_range(struct f_val v1, struct f_val v2)
if (res != CMP_ERROR)
return res;
- if (((v1.type == T_INT) || (v1.type == T_IP)) && (v2.type == T_SET)) {
+ if (((v1.type == T_INT) || ((v1.type == T_IP) || (v1.type == T_PREFIX)) && (v2.type == T_SET))) {
struct f_tree *n;
n = find_tree(v2.val.t, v1);
if (!n)