diff options
author | Pavel Machek <pavel@ucw.cz> | 2000-04-26 11:36:47 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2000-04-26 11:36:47 +0200 |
commit | 2e5a8735f4be2c2514ae3a67960ea4ac3f06e364 (patch) | |
tree | 8717942e977865c6bbc11a9bf3c6978c03ade0ad /filter | |
parent | f71bded6e97a3eeb4dc58458d042cbe1af631380 (diff) | |
download | bird-2e5a8735f4be2c2514ae3a67960ea4ac3f06e364.tar bird-2e5a8735f4be2c2514ae3a67960ea4ac3f06e364.zip |
filter_same should now work with path masks.
Diffstat (limited to 'filter')
-rw-r--r-- | filter/filter.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/filter/filter.c b/filter/filter.c index 350cb08..63f8967 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -28,6 +28,17 @@ struct f_inst *startup_func = NULL, *test1_func, *test2_func; #define CMP_ERROR 999 +int +pm_path_compare(struct f_path_mask *m1, struct f_path_mask *m2) +{ + while (1) { + if ((!m1) || (!m2)) + return !((!m1) && (!m2)); + m1 = m1->next; + m2 = m2->next; + } +} + /* Compare two values, returns -1, 0, 1 compared, ERROR 999 */ int val_compare(struct f_val v1, struct f_val v2) @@ -53,6 +64,8 @@ val_compare(struct f_val v1, struct f_val v2) case T_IP: case T_PREFIX: return ipa_compare(v1.val.px.ip, v2.val.px.ip); + case T_PATH_MASK: + return pm_path_compare(v1.val.path_mask, v2.val.path_mask); default: debug( "Compare of unkown entities: %x\n", v1.type ); return CMP_ERROR; |