summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-09-01 14:21:56 +0200
committerMaria Matejka <mq@ucw.cz>2022-09-01 17:44:46 +0200
commit397fec4741b40f61d06a467b4110aad7e996485c (patch)
tree4bd33355175e42df9e3b7dee5517c19d4d6e337d /proto
parent34912b029b161cbbed44057dfa913669ccb087eb (diff)
Default tables are not created unless actually used.
This allows for setting default table values at the beginning of config file before "master4" and "master6" tables are initialized.
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/bgp.c4
-rw-r--r--proto/static/static.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 68c788ea..97b18fcf 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1934,7 +1934,7 @@ bgp_default_igp_table(struct bgp_config *cf, struct bgp_channel_config *cc, u32
return cc2->c.table;
/* Last, try default table of given type */
- if (tab = cf->c.global->def_tables[type])
+ if (tab = rt_get_default_table(cf->c.global, type))
return tab;
cf_error("Undefined IGP table");
@@ -1953,7 +1953,7 @@ bgp_default_base_table(struct bgp_config *cf, struct bgp_channel_config *cc)
return cc2->c.table;
/* Last, try default table of given type */
- struct rtable_config *tab = cf->c.global->def_tables[type];
+ struct rtable_config *tab = rt_get_default_table(cf->c.global, type);
if (tab)
return tab;
diff --git a/proto/static/static.c b/proto/static/static.c
index 65f3eccc..cb764a1c 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -436,11 +436,11 @@ static_postconfig(struct proto_config *CF)
if (!cf->igp_table_ip4)
cf->igp_table_ip4 = (cc->table->addr_type == NET_IP4) ?
- cc->table : cf->c.global->def_tables[NET_IP4];
+ cc->table : rt_get_default_table(cf->c.global, NET_IP4);
if (!cf->igp_table_ip6)
cf->igp_table_ip6 = (cc->table->addr_type == NET_IP6) ?
- cc->table : cf->c.global->def_tables[NET_IP6];
+ cc->table : rt_get_default_table(cf->c.global, NET_IP6);
WALK_LIST(r, cf->routes)
if (r->net && (r->net->type != CF->net_type))