From 758458be054ebdf4cd77620faf214f2b491a49dc Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 13 May 2000 11:17:49 +0000 Subject: Unified parsing of prefixes. Had to rename `prefix' in filters to `fprefix'. --- nest/config.Y | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'nest') diff --git a/nest/config.Y b/nest/config.Y index e5249ea..f92c054 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -124,8 +124,8 @@ debug_default: iface_patt: TEXT { this_ipatt->pattern = $1; this_ipatt->prefix = IPA_NONE; this_ipatt->pxlen = 0; } - | IPA pxlen { this_ipatt->pattern = NULL; this_ipatt->prefix = $1; this_ipatt->pxlen = $2; } - | TEXT IPA pxlen { this_ipatt->pattern = $1; this_ipatt->prefix = $2; this_ipatt->pxlen = $3; } + | prefix { this_ipatt->pattern = NULL; this_ipatt->prefix = $1.addr; this_ipatt->pxlen = $1.len; } + | TEXT prefix { this_ipatt->pattern = $1; this_ipatt->prefix = $2.addr; this_ipatt->pxlen = $2.len; } ; /* Direct device route protocol */ @@ -250,12 +250,11 @@ r_args: $$->filter = FILTER_ACCEPT; $$->table = config->master_rtc->table; } - | r_args IPA pxlen { + | r_args prefix { $$ = $1; if ($$->pxlen != 256) cf_error("Only one prefix expected"); - if (!ip_is_prefix($2, $3)) cf_error("Invalid prefix"); - $$->prefix = $2; - $$->pxlen = $3; + $$->prefix = $2.addr; + $$->pxlen = $2.len; } | r_args TABLE SYM { $$ = $1; -- cgit v1.2.3