summaryrefslogtreecommitdiff
path: root/bgpd/bgp_advertise.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-09-10 09:27:51 -0400
committerDonald Sharp <sharpd@nvidia.com>2023-09-11 12:45:59 -0400
commite6458d36b7f9347815ccd2aa2d4af8107f84fce5 (patch)
treebf8e8f852a1af3524a59e98a539ada2f21c83aed /bgpd/bgp_advertise.c
parent493075d25b1686661b89e2e6bc68cec55ed5054b (diff)
bgpd: bgp_adj_in_unset needs to return the dest pointer
This is incase it has been freed ( it wont due to locking ) and then we need to ensure that we can continue to use the pointer. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_advertise.c')
-rw-r--r--bgpd/bgp_advertise.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c
index c215611edf..6f4916b3c3 100644
--- a/bgpd/bgp_advertise.c
+++ b/bgpd/bgp_advertise.c
@@ -197,13 +197,13 @@ void bgp_adj_in_remove(struct bgp_dest **dest, struct bgp_adj_in *bai)
XFREE(MTYPE_BGP_ADJ_IN, bai);
}
-bool bgp_adj_in_unset(struct bgp_dest *dest, struct peer *peer,
+bool bgp_adj_in_unset(struct bgp_dest **dest, struct peer *peer,
uint32_t addpath_id)
{
struct bgp_adj_in *adj;
struct bgp_adj_in *adj_next;
- adj = dest->adj_in;
+ adj = (*dest)->adj_in;
if (!adj)
return false;
@@ -212,11 +212,11 @@ bool bgp_adj_in_unset(struct bgp_dest *dest, struct peer *peer,
adj_next = adj->next;
if (adj->peer == peer && adj->addpath_rx_id == addpath_id)
- bgp_adj_in_remove(&dest, adj);
+ bgp_adj_in_remove(dest, adj);
adj = adj_next;
- assert(dest);
+ assert(*dest);
}
return true;