aboutsummaryrefslogtreecommitdiffstats
path: root/main/quagga/bgpd-gr-route-selection-fix.patch
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 /main/quagga/bgpd-gr-route-selection-fix.patch
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
Diffstat (limited to 'main/quagga/bgpd-gr-route-selection-fix.patch')
-rw-r--r--main/quagga/bgpd-gr-route-selection-fix.patch37
1 files changed, 37 insertions, 0 deletions
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)