diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2020-06-03 20:07:41 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2020-06-26 16:41:06 +0900 |
commit | a001112f81eddc611260ab55a56907219e422cd0 (patch) | |
tree | ed2a551768da08e9f0e6603c7f815d4e6bf2331b | |
parent | 75d1ac0055b28bb85f4c75c8cb1cb92485f2cf91 (diff) | |
download | bird-ky/filter-pmi-compare-asn-set.tar.gz |
Filter: Improve handling of sets in BGP path masksky/filter-pmi-compare-asn-set
This is a follow-up for commit ef113c6f7253 ("Filter: Allow to use sets
in path masks", 2019-08-06).
Compare the content of PM_ASN_SET in path masks. A reconfiguration
was not properly triggering a reload of affected protocols when the
members of a set in a path mask change.
Also, update the printing code to so that it can display sets in a path
mask.
-rw-r--r-- | filter/data.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/filter/data.c b/filter/data.c index 9547a4c8..7c33d2cb 100644 --- a/filter/data.c +++ b/filter/data.c @@ -121,6 +121,11 @@ pm_format(const struct f_path_mask *p, buffer *buf) buffer_print(buf, "%u..%u ", p->item[i].from, p->item[i].to); break; + case PM_ASN_SET: + tree_format(p->item[i].set, buf); + buffer_puts(buf, " "); + break; + case PM_ASN_EXPR: ASSERT(0); } @@ -221,6 +226,10 @@ pmi_same(const struct f_path_mask_item *mi1, const struct f_path_mask_item *mi2) if (mi1->to != mi2->to) return 0; break; + case PM_ASN_SET: + if (!same_tree(mi1->set, mi2->set)) + return 0; + break; } return 1; |