]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: add addpath ID to adj_out tree sort 5690/head
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:07:17 +0000 (11:07 +0200)
commit96aa3770c27b6bf34b8e3bce280427ec47ab918f
tree25b261174c46851f6e137b85307a09de73bdb681
parentfb4e262522040e212b9ebe89f62421ad37f90add
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