0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Kernel: Fix crash for merge paths on if no route is in BIRD

There was a missing check for a NULL return value.
Also fixed an indenting error.

Thanks to Radu Anghel for reporting it:
https://bird.network.cz/pipermail/bird-users/2024-December/017977.html
This commit is contained in:
Maria Matejka 2024-12-19 11:00:15 +01:00
parent e7bd976178
commit b6caccfd45

View File

@ -5265,14 +5265,14 @@ krt_export_net(struct channel *c, const net_addr *a, linpool *lp)
if (c->ra_mode == RA_MERGED) if (c->ra_mode == RA_MERGED)
{ {
struct rt_export_feed *feed = rt_net_feed(c->table, a, NULL); struct rt_export_feed *feed = rt_net_feed(c->table, a, NULL);
if (!feed->count_routes) if (!feed || !feed->count_routes)
return NULL; return NULL;
if (!bmap_test(&c->export_accepted_map, feed->block[0].id)) if (!bmap_test(&c->export_accepted_map, feed->block[0].id))
return NULL; return NULL;
return rt_export_merged(c, feed, lp, 1); return rt_export_merged(c, feed, lp, 1);
} }
static _Thread_local rte best; static _Thread_local rte best;
best = rt_net_best(c->table, a); best = rt_net_best(c->table, a);