]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: add addpath ID to adj_out tree sort
authorMitchell Skiba <mskiba@amazon.com>
Thu, 9 Jan 2020 19:46:13 +0000 (11:46 -0800)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Thu, 16 Jan 2020 09:08:02 +0000 (11:08 +0200)
commitdef2c27e49125ad523cd36ed16dd787946640dba
tree3d64922a6fbc4d41b9b0cd18702659805298ba64
parent14c56d646c91b8ddfae4c186776c38ffd0112ed7
bgpd: add addpath ID to adj_out tree sort

When withdrawing addpaths, adj_lookup was called to find the path that
needed to be withdrawn. It would lookup in the RB tree based on subgroup
pointer alone, often find the path with the wrong addpath ID, and return
null.  Only the path highest in the tree sent to the subgroup could be
found, thus withdrawn.

Adding the addpath ID to the sort criteria for the RB tree allows us to
simplify the logic for adj_lookup, and address this problem. We are able
to remove the logic around non-addpath subgroups because the addpath ID
is consistently 0 for non-addpath adj_outs, so special logic to skip
matching the addpath ID isn't required.  (As a side note, addpath will
also never use ID 0, so there won't be any ambiguity when looking at the
structure content.)

Signed-off-by: Mitchell Skiba <mskiba@amazon.com>
bgpd/bgp_updgrp_adv.c