]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Check correct address types during aggregation configuration
authorIgor Putovny <igor.putovny@nic.cz>
Thu, 7 Mar 2024 14:39:54 +0000 (15:39 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Thu, 30 May 2024 10:30:00 +0000 (12:30 +0200)
proto/aggregator/config.Y

index cec24c60f9e0ac2eadf1e1908da6f513c5ef6e99..f37d842c61cd13658e7cc21452c8f8ae3868f10f 100644 (file)
@@ -82,7 +82,14 @@ aggregator_proto_item:
 ;
 
 aggregator_proto_opts: /* empty */ | aggregator_proto_opts aggregator_proto_item ';' ;
-aggregator_proto: aggregator_proto_start proto_name '{' aggregator_proto_opts '}' ;
+aggregator_proto: aggregator_proto_start proto_name '{' aggregator_proto_opts '}' {
+  if (AGGREGATOR_CFG->src->table->addr_type != AGGREGATOR_CFG->dst->table->addr_type)
+    cf_error("Both rtables in aggregator must have the same network type");
+
+  if (AGGREGATOR_CFG->net_present == 0)
+    if (AGGREGATOR_CFG->src->table->addr_type != NET_IP4 && AGGREGATOR_CFG->src->table->addr_type != NET_IP6)
+      cf_error("Trie aggregation is available only for IP4 or IPv6 networks");
+};
 
 
 aggr_list: