summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_network.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@hpe.com>2015-11-25 17:14:37 +0000
committerPaul Jakma <paul.jakma@hpe.com>2016-02-18 15:54:45 +0000
commit6d4742bef722e6fab45fb6eb22ed2c7b7570a2e6 (patch)
tree5f448656a3f81e684df289e42cc3bd051850e17f /bgpd/bgp_network.c
parent91b9e8547a7c5697d5d7481f9476778077024019 (diff)
downloadquagga-6d4742bef722e6fab45fb6eb22ed2c7b7570a2e6.tar.bz2
quagga-6d4742bef722e6fab45fb6eb22ed2c7b7570a2e6.tar.xz
bgpd: make bgp_info_cmp and multiple-path decision logic more regular
* bgp_route.c: (bgp_info_cmp) This function is supposed to return a preference between the given paths, and does so as binary either or. When mpath was added, the binary return value was left as is and instead an out parameter 'paths_eq' was added to indicate the mpath-equality case. It's a bit odd, as is the resulting logic in the caller. Regularise things again by making the function return a strcmp like trinary return value of -1,0,1. Get rid of the mpath specific arguments, but pass in afi/safi as part of the general context - that plus the (struct bgp *) is enough to access configuration. Update the return values. The mpath check was testing the IGP metric for equality, even though previous to the mpath changes (and consistent with the behaviour of all the other tests bar the end), equality results in continuing through to the next comparison. Just go back to the previous way - each test finds a preference to return, or continues on to let further tests have a go. (bgp_best_selection) Get rid of the (struct bgp_maxpaths_cfg *) arg, we can't add state for every optional feature to the argument list - they have to look it up as needed. Do pass through the very general afi/safi context though (saves several lookups through the route_node). Adjust for the new trinary bgp_info_cmp return value and updated args. Do the mpath clearing/accumulation in one place, in each loop. Call to bgp_info_mpath_update similarly gets updated, as there's no cfg to pass. (bgp_process_{rsclient,main}) match bgp_best_selection changes. * bgp_mpath.c: (bgp_mpath_is_configured_sort) Helper for whether mpath is enabled by peer sort. (bgp_mpath_is_configured) ditto, generally. (bgp_info_mpath_update) caller no longer has the cfg to pass in, look it up. * bgp_mpath.h: Export the above and Match .c changes. Requires commit: "bgpd: bgp_scan shouldn't queue up route_nodes with no routes for processing" Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_network.c')
0 files changed, 0 insertions, 0 deletions