In a removal operation do not allow a creation of the route_node in bgp#21878
In a removal operation do not allow a creation of the route_node in bgp#21878donaldsharp wants to merge 9 commits into
Conversation
Do not create the rd table if in a negate operation. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Convert get of the two level table into a lookup so that there is no creation/deletion of the table on withdrawal. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Switch to _lookup for finding the parent dest and not create and then delete the node on deletion. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Do not use a get operation on withdrawal, do a lookup and only do the withdrawal if found, to avoid a alloc/free cycle. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
When removing a node, use lookup instead of a get/free cycle. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Avoid a alloc/free cycle on the removal case by doing a lookup instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Use a lookup to avoid a get/free cycle in the deletion case. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Use a lookup to avoid the creation/deletion of a node in the removal case. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Use lookup to avoid a get/free cycle on the removal case. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Greptile SummaryThis PR replaces
Confidence Score: 3/5The negate branch in bgp_static_set can reach bgp_node_lookup with a NULL table, which would crash bgpd. The negate branch in bgp_static_set fetches table from pdest without a NULL check and immediately passes it to bgp_node_lookup; the original code always ensured the table was initialized before this point, so a corrupted or partially-initialized pdest node could crash bgpd on this path. bgpd/bgp_route.c — specifically the negate branch in bgp_static_set around line 8758 Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[bgp_static_set called] --> B{safi == SAFI_MPLS_VPN or SAFI_EVPN?}
B -- No --> C[table = bgp->static_routes]
B -- Yes --> D[bgp_node_lookup prd]
D --> E{negate?}
E -- No --> F{pdest found?}
F -- No --> G[bgp_node_get: create node]
F -- Yes --> H[existing pdest]
G --> I{has path info data?}
H --> I
I -- No --> J[bgp_table_init + set_table_info]
I -- Yes --> K[table = get_bgp_table_info pdest]
J --> K
E -- Yes --> L{pdest found?}
L -- No --> M[Error: RD not found, return CMD_WARNING]
L -- Yes --> N[table = get_bgp_table_info pdest]
N --> O{table NULL?}
O -- Yes --> P[bgp_node_lookup NULL, crash risk]
O -- No --> Q[bgp_node_lookup prefix in table]
K --> Q
|
|
ci:rerun |
|
ci:rerun |
1 similar comment
|
ci:rerun |
No description provided.