Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Ensure send order is 100% consistent #14468

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions bgpd/bgp_advertise.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,25 @@ void bgp_advertise_free(struct bgp_advertise *adv)
void bgp_advertise_add(struct bgp_advertise_attr *baa,
struct bgp_advertise *adv)
{
adv->next = baa->adv;
if (baa->adv)
baa->adv->prev = adv;
baa->adv = adv;
struct bgp_advertise *spot, *prev = NULL;

spot = baa->adv;

while (spot) {
prev = spot;
spot = spot->next;
}

if (prev) {
prev->next = adv;
adv->prev = prev;
} else
adv->prev = NULL;

adv->next = NULL;

if (!baa->adv)
baa->adv = adv;
}

void bgp_advertise_delete(struct bgp_advertise_attr *baa,
Expand Down