diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-13 11:17:49 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-13 11:17:49 +0000 |
commit | 758458be054ebdf4cd77620faf214f2b491a49dc (patch) | |
tree | e8cdebbcf3095ddc1db63ac3c5b611f9708c9879 /nest | |
parent | 02bd064ab76f163313261dad5c273cb376be2a75 (diff) |
Unified parsing of prefixes.
Had to rename `prefix' in filters to `fprefix'.
Diffstat (limited to 'nest')
-rw-r--r-- | nest/config.Y | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/nest/config.Y b/nest/config.Y index e5249ea4..f92c0541 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; |