summaryrefslogtreecommitdiffstats
path: root/filter/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-04-17 01:48:36 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-04-17 01:48:36 +0200
commitc8a6b9a3d199444fd45879dd5cc5ececd9624822 (patch)
tree1ada700f499ec771ea68873c87b51bc71b455a27 /filter/config.Y
parent024c310b537abc3ddbac3054de71fd759d422824 (diff)
downloadbird-c8a6b9a3d199444fd45879dd5cc5ececd9624822.tar
bird-c8a6b9a3d199444fd45879dd5cc5ececd9624822.zip
Rewrite of buggy AS path matching.
Old AS path maching supposes thath AS number appears only once in AS path, but that is not true. It also contains some bugs related to AS path sets. New code does not use any assumptions about semantic structure of AS path. It is asymptotically slower than the old code, but on real paths it is not significant. It also allows '?' for matching one arbitrary AS number.
Diffstat (limited to 'filter/config.Y')
-rw-r--r--filter/config.Y9
1 files changed, 5 insertions, 4 deletions
diff --git a/filter/config.Y b/filter/config.Y
index b6a0f47..6d9b064 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -284,14 +284,15 @@ bgp_path:
;
bgp_path_tail1:
- NUM bgp_path_tail1 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->val = $1; $$->any = 0; }
- | '*' bgp_path_tail1 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->val = 0; $$->any = 1; }
+ NUM bgp_path_tail1 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->kind = PM_ASN; $$->val = $1; }
+ | '*' bgp_path_tail1 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->kind = PM_ASTERISK; $$->val = 0; }
+ | '?' bgp_path_tail1 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->kind = PM_QUESTION; $$->val = 0; }
| { $$ = NULL; }
;
bgp_path_tail2:
- NUM bgp_path_tail2 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->val = $1; $$->any = 0; }
- | '?' bgp_path_tail2 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->val = 0; $$->any = 1; }
+ NUM bgp_path_tail2 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->kind = PM_ASN; $$->val = $1; }
+ | '?' bgp_path_tail2 { $$ = cfg_alloc(sizeof(struct f_path_mask)); $$->next = $2; $$->kind = PM_ASTERISK; $$->val = 0; }
| { $$ = NULL; }
;