From dc34c1a4fddab9a0f00792f680b7184957020f83 Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Thu, 19 Dec 2024 18:19:25 +0100 Subject: [PATCH] net-misc/bird: Fix crash for merge paths https://bird.network.cz/pipermail/bird-users/2024-December/017986.html Signed-off-by: Alarig Le Lay --- metadata/md5-cache/net-misc/bird-3.0.0 | 2 +- net-misc/bird/bird-3.0.0.ebuild | 4 ++ .../files/bird-3.0.0-nest-rt-table.c.patch | 38 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 net-misc/bird/files/bird-3.0.0-nest-rt-table.c.patch diff --git a/metadata/md5-cache/net-misc/bird-3.0.0 b/metadata/md5-cache/net-misc/bird-3.0.0 index 9682ee0..74a8516 100644 --- a/metadata/md5-cache/net-misc/bird-3.0.0 +++ b/metadata/md5-cache/net-misc/bird-3.0.0 @@ -11,4 +11,4 @@ RDEPEND=client? ( sys-libs/ncurses:= sys-libs/readline:= ) filecaps? ( acct-grou SLOT=0 SRC_URI=ftp://bird.network.cz/pub/bird/bird-3.0.0.tar.gz _eclasses_=gnuconfig ddeb9f8caff1b5f71a09c75b7534df79 toolchain-funcs fa554cc3cff825d21dfe3f24841e29cf multilib b2a329026f2e404e9e371097dda47f96 libtool 6b28392a775f807c8be5fc7ec9a605b9 autotools 7d91cc798a8afd8f4e0c6e9587296ebe fcaps 27152c9e4da035accb14a2d7879744ef -_md5_=a8a31444cb89022fc4dc3f8a0e42ab88 +_md5_=12cc3ec227c021ad52ded63dd738a74c diff --git a/net-misc/bird/bird-3.0.0.ebuild b/net-misc/bird/bird-3.0.0.ebuild index 896e1e7..81d69e8 100644 --- a/net-misc/bird/bird-3.0.0.ebuild +++ b/net-misc/bird/bird-3.0.0.ebuild @@ -36,6 +36,10 @@ FILECAPS=( CAP_NET_RAW usr/sbin/bird ) +PATCHES=( + "${FILESDIR}"/${P}-nest-rt-table.c.patch +) + src_prepare() { default eautoreconf diff --git a/net-misc/bird/files/bird-3.0.0-nest-rt-table.c.patch b/net-misc/bird/files/bird-3.0.0-nest-rt-table.c.patch new file mode 100644 index 0000000..50e714e --- /dev/null +++ b/net-misc/bird/files/bird-3.0.0-nest-rt-table.c.patch @@ -0,0 +1,38 @@ +From b6caccfd45fb639b6dd3a8d140d3c5ba4cc79311 Mon Sep 17 00:00:00 2001 +From: Maria Matejka +Date: Thu, 19 Dec 2024 11:00:15 +0100 +Subject: [PATCH] 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 +--- + nest/rt-table.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/nest/rt-table.c b/nest/rt-table.c +index fd8bb50dd..05191d743 100644 +--- a/nest/rt-table.c ++++ b/nest/rt-table.c +@@ -5265,14 +5265,14 @@ krt_export_net(struct channel *c, const net_addr *a, linpool *lp) + if (c->ra_mode == RA_MERGED) + { + struct rt_export_feed *feed = rt_net_feed(c->table, a, NULL); +- if (!feed->count_routes) ++ if (!feed || !feed->count_routes) + return NULL; + + if (!bmap_test(&c->export_accepted_map, feed->block[0].id)) + return NULL; + + return rt_export_merged(c, feed, lp, 1); +- } ++ } + + static _Thread_local rte best; + best = rt_net_best(c->table, a); +-- +GitLab +