]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Aggregator: Fixed bugs in filter usage
authorMaria Matejka <mq@ucw.cz>
Wed, 1 Nov 2023 09:57:43 +0000 (10:57 +0100)
committerMaria Matejka <mq@ucw.cz>
Wed, 1 Nov 2023 09:57:43 +0000 (10:57 +0100)
nest/rt-table.c
proto/aggregator/config.Y
proto/aggregator/test.conf

index d3ef231d62f1d007e8c97b9f278c0400ff8850d9..a8f6226dafa0d437176667c85603ab7786be4a90 100644 (file)
@@ -1210,7 +1210,7 @@ rte_same(rte *x, rte *y)
 {
   /* rte.flags / rte.pflags are not checked, as they are internal to rtable */
   return
-    (
+    (x == y) || (
      (x->attrs == y->attrs) ||
      ((!x->attrs->cached || !y->attrs->cached) && rta_same(x->attrs, y->attrs))
     ) &&
index ba4eb9c456b9119f6a4748c0f638b4dbed01362b..93d7cb571a3201c647f0daf927dc9640ef81488a 100644 (file)
@@ -52,8 +52,17 @@ aggregator_proto_item:
     if (!AGGREGATOR_CFG->aggr_on_net)
       cf_error("aggregate on must be always include 'net'.");
 
+   struct f_inst *rot = NULL;
+   while ($4.begin)
+   {
+     struct f_inst *tmp = $4.begin->next;
+     $4.begin->next = rot;
+     rot = $4.begin;
+     $4.begin = tmp;
+   }
+
    AGGREGATOR_CFG->aggr_on_count = count;
-   AGGREGATOR_CFG->aggr_on = f_linearize($4.begin, count);
+   AGGREGATOR_CFG->aggr_on = f_linearize(rot, count);
 
    struct f_line *premerge = f_linearize($4.end, 0);
    premerge->args = count;
index ec7afc4fea4b3a0c5c0e0f189a2c5faa2387ec9a..e5ac69694e3ad45023fc939fdbb3fef3313cca5a 100644 (file)
@@ -1,9 +1,17 @@
 log "bird.log" all;
 
+attribute int foo;
+
 protocol device {}
 
 protocol static {
-  ipv6;
+  ipv6 {
+    import filter {
+      preference = 111;
+      foo = 666;
+      accept;
+    };
+  };
   route 2001:db8:0::/48 unreachable { bgp_path.prepend(65432); bgp_path.prepend(4200000000); };
   route 2001:db8:1::/48 unreachable;
   route 2001:db8:2::/48 unreachable;
@@ -25,6 +33,8 @@ protocol static {
 protocol static {
   ipv6 {
     import filter {
+      preference = 222;
+      foo = 666;
       bgp_med = 1;
       bgp_community = -empty-.add((65533,1)).add((65500,0xe));
       accept;
@@ -43,6 +53,8 @@ protocol static {
 protocol static {
   ipv6 {
     import filter {
+      preference = 222;
+      foo = 666;
       bgp_med = 2;
       bgp_community = -empty-.add((65533,2)).add((65500,0xd));
       accept;
@@ -61,6 +73,8 @@ protocol static {
 protocol static {
   ipv6 {
     import filter {
+      preference = 222;
+      foo = 666;
       bgp_med = 4;
       bgp_community = -empty-.add((65533,4)).add((65500,0xb));
       accept;
@@ -79,6 +93,8 @@ protocol static {
 protocol static {
   ipv6 {
     import filter {
+      preference = 222;
+      foo = 666;
       bgp_med = 8;
       bgp_community = -empty-.add((65533,8)).add((65500,0x7));
       accept;