X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=blobdiff_plain;f=package%2Fquagga%2Fnot-patches%2Fpatches-old%2F130-bgpd_ignore_stale_entry.patch;fp=package%2Fquagga%2Fnot-patches%2Fpatches-old%2F130-bgpd_ignore_stale_entry.patch;h=33a8610babbd6188258bc0157ea24d7d28a09c4f;hp=0000000000000000000000000000000000000000;hb=30b136923fe6a874a4bbd430c83b7d656607931b;hpb=0b111996782aa58aef2891eeccdb8bd9875c27ae diff --git a/package/quagga/not-patches/patches-old/130-bgpd_ignore_stale_entry.patch b/package/quagga/not-patches/patches-old/130-bgpd_ignore_stale_entry.patch new file mode 100644 index 000000000..33a8610ba --- /dev/null +++ b/package/quagga/not-patches/patches-old/130-bgpd_ignore_stale_entry.patch @@ -0,0 +1,52 @@ +From bd4b7f1559ab5cb52bbe9dc2db9e50a032ccdbb7 Mon Sep 17 00:00:00 2001 +From: vivek +Date: Tue, 30 Sep 2014 15:54:45 -0700 +Subject: [PATCH] bgpd: Ignore stale entry candidates during bestpath + selection. + +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. + +Signed-off-by: Vivek Venkataraman +Reviewed-by: Dinesh G Dutt +--- + bgpd/bgp_route.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c +index 34ba1ab..648dc9c 100644 +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -524,7 +524,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 +@@ -553,6 +557,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) +-- +2.7.0 +