aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-12-17 13:37:03 +0200
committerTimo Teräs <timo.teras@iki.fi>2014-12-17 13:44:14 +0200
commit102e9e432d62d3b838b7d08923cbb456cfa1b65c (patch)
tree2f87e87acf23bd421bb0270e6cf37d0701a783a6
parentdd266db9177bbe702551e85e5627bed6c6253595 (diff)
downloadaports-102e9e432d62d3b838b7d08923cbb456cfa1b65c.tar.bz2
aports-102e9e432d62d3b838b7d08923cbb456cfa1b65c.tar.xz
main/quagga: apply fix to rare bgpd crash during route selection
patch picked up from Cumulus Network's quagga patch queue
-rw-r--r--main/quagga/APKBUILD8
-rw-r--r--main/quagga/bgpd-gr-route-selection-fix.patch37
2 files changed, 43 insertions, 2 deletions
diff --git a/main/quagga/APKBUILD b/main/quagga/APKBUILD
index 17d0831a9b..82fa25a6ad 100644
--- a/main/quagga/APKBUILD
+++ b/main/quagga/APKBUILD
@@ -1,19 +1,20 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=quagga
pkgver=0.99.23.1
-pkgrel=0
+pkgrel=1
pkgdesc="A free routing daemon replacing Zebra supporting RIP, OSPF and BGP."
url="http://quagga.net/"
arch="all"
license="GPL-2"
depends="iproute2"
-makedepends="readline-dev ncurses-dev gawk texinfo perl net-snmp-dev"
+makedepends="linux-headers readline-dev ncurses-dev gawk texinfo perl net-snmp-dev"
install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg"
pkgusers="quagga"
pkggroups="quagga"
source="http://download.savannah.gnu.org/releases/quagga/quagga-$pkgver.tar.xz
1001-bgpd-implement-next-hop-self-all.patch
+ bgpd-gr-route-selection-fix.patch
bgpd.initd
zebra.initd
zebra.confd
@@ -72,16 +73,19 @@ package() {
}
md5sums="da14aed6ae4be582486816f3eac2a46f quagga-0.99.23.1.tar.xz
cb97c9d7e192ca05b64c9da909daa97a 1001-bgpd-implement-next-hop-self-all.patch
+1fbfcff69bc7df56f9e6682012261004 bgpd-gr-route-selection-fix.patch
e80a3df594eba8b09e19aa28d9283698 bgpd.initd
33d0e34f11460881161ab930d3d3b987 zebra.initd
34e06a1d2bc602ce691abc9ed169dd15 zebra.confd"
sha256sums="202e8b7fbec810f28a84e3fbb6aafdaf08a3b51527c258807abc8a74ed617eb8 quagga-0.99.23.1.tar.xz
cd1a3cebe2e666fe95036dac5fe0b4c19772dc1d39859f5390c5c5d84695b8b3 1001-bgpd-implement-next-hop-self-all.patch
+66de5b7c097aeb1767001547e219af51e43f968bd241dec7f0c71b68b54855de bgpd-gr-route-selection-fix.patch
41471bfda120cb57bc0f40e87ec23a4f150d2b97c97ececdda6c408eab7cf9a3 bgpd.initd
d6cc9280df63859ba711ad2071b38b9ce317d718c34840a2b101debef3fa7b56 zebra.initd
f7a52d383f60270a5a8fee5d4ac522c5c0ec2b7c4b5252cff54e260f32d9b323 zebra.confd"
sha512sums="7a222d4a5aa41deeb233f2e9ce922e5c29787c2f74c1b99177089e3183b69d3c0e4db5846676485a1990b728e007e687070ba4cecab67aa61f8be6c0851581cc quagga-0.99.23.1.tar.xz
a8b7c2f8c4e31841b735f17e2476adfc5d0b9caee4808ade19774fedf8abf935f0afda1bf43e79606dd5aca821a11435b69c84eec3cd6860c24e35775ff0bc3e 1001-bgpd-implement-next-hop-self-all.patch
+3e3e1862739ed47da38720d87669ee0bfa2d6e2c2c65388727c92a22cad8b5bf9f4c302701cbd0cf3ac0186eeb1498aefed74c85d8f43ced41c78680fdbbc2ac bgpd-gr-route-selection-fix.patch
d2bf7e8f2da49d0b039e72e76a77860b5b49d41a80550d6dc84791bbdec1d52e579393c5d42b45aa615991742421fef53ec1b92a5e740779b6060e20f5dd0413 bgpd.initd
a4955fe54729ec8cb17b72f3d2205d0a4ba814a51a5eb3635a85339de9a2d2342e4814ef8b1e011803fa1dc3c6f9a23b178848e0812576876343104854feb723 zebra.initd
900972c6f98e561dfacf384111251db262326e8764b8c763a5ef639fa11c7949c03eef5e3bce324a4b1964fe45416d2db74ae1b6bc967f7d4ba48c2eeda017c4 zebra.confd"
diff --git a/main/quagga/bgpd-gr-route-selection-fix.patch b/main/quagga/bgpd-gr-route-selection-fix.patch
new file mode 100644
index 0000000000..36719d3755
--- /dev/null
+++ b/main/quagga/bgpd-gr-route-selection-fix.patch
@@ -0,0 +1,37 @@
+During best path selection, if one of the candidates is a stale entry, do not
+perform the neighbor address comparison as that information is invalid for
+the stale entry. Attempting to perform the comparison results in a bgpd
+exception.
+
+diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
+index cca26d8..d30c643 100644
+--- a/bgpd/bgp_route.c
++++ b/bgpd/bgp_route.c
+@@ -540,7 +540,11 @@ bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist,
+ return 0;
+ }
+
+- /* 11. Rourter-ID comparision. */
++ /* 11. Router-ID comparision. */
++ /* If one of the paths is "stale", the corresponding peer router-id will
++ * be 0 and would always win over the other path. If originator id is
++ * used for the comparision, it will decide which path is better.
++ */
+ if (newattr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))
+ new_id.s_addr = newattre->originator_id.s_addr;
+ else
+@@ -565,6 +569,14 @@ bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist,
+ return 0;
+
+ /* 13. Neighbor address comparision. */
++ /* Do this only if neither path is "stale" as stale paths do not have
++ * valid peer information (as the connection may or may not be up).
++ */
++ if (CHECK_FLAG (exist->flags, BGP_INFO_STALE))
++ return 1;
++ if (CHECK_FLAG (new->flags, BGP_INFO_STALE))
++ return 0;
++
+ ret = sockunion_cmp (new->peer->su_remote, exist->peer->su_remote);
+
+ if (ret == 1)