isisd: clear route-map reference on redistribute unset#22368
Conversation
Greptile SummaryThis PR fixes two related resource-management bugs in
Confidence Score: 5/5Safe to merge — the change is a targeted cleanup of two resource-management paths with no behavioral changes to route advertisement logic. Both hunks replace either a missing cleanup or an incomplete one with the existing isis_redist_routemap_set(redist, NULL) helper, which already handles the NULL case as a no-op. The struct is still freed after the helper returns, so there is no use-after-free. The area-finish loop uses ALL_LIST_ELEMENTS (safe for in-loop deletion). No new logic is introduced and the change is consistent with how the same helper is used elsewhere in the file. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI
participant isis_redist_unset
participant isis_redist_routemap_set
participant route_map
CLI->>isis_redist_unset: no redistribute ipv4 ospf
isis_redist_unset->>isis_redist_unset: "redist->redist = 0"
isis_redist_unset->>isis_redist_routemap_set: isis_redist_routemap_set(redist, NULL)
isis_redist_routemap_set->>route_map: "route_map_counter_decrement(redist->map)"
isis_redist_routemap_set->>isis_redist_routemap_set: "XFREE map_name, map = NULL"
isis_redist_routemap_set-->>isis_redist_unset: done
isis_redist_unset->>isis_redist_unset: listnode_delete + XFREE redist
Note over CLI,route_map: isis_redist_area_finish follows the same path
Reviews (1): Last reviewed commit: "isisd: clear route-map ref on redistribu..." | Re-trigger Greptile |
83ccd93 to
e4dc3d6
Compare
|
Please use a real email address in your commit sign-offs |
riw777
left a comment
There was a problem hiding this comment.
code looks good ... but can you fix the sign off email?
Clear the route-map reference through the existing helper when IS-IS redistribution is removed so the route-map use count is updated. Signed-off-by: Evelyn0828 <jxshuibei@gmail.com>
e4dc3d6 to
755037a
Compare
|
Sign-off email fixed ( |
|
The |
|
Tick the box to add this pull request to the merge queue (same as
|
Release the route-map reference when an IS-IS redistribution entry is removed or when the area is torn down. This keeps
show route-map unusedconsistent after the redistribution command is removed.CLOSES #22361