Rename *_prefix_match to *_prefix_contains#22162
Conversation
Greptile SummaryThis PR performs a global rename of
Confidence Score: 4/5Safe to merge — the rename is purely cosmetic with no behavioural changes anywhere in the codebase. Every call site and the function declarations were updated correctly. The only gap is a single stale comment in zebra_srv6.c that still says "prefix_match" instead of "prefix_contains", which has no runtime impact. zebra/zebra_srv6.c — one comment at line 1333 still references the old name. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["prefix_contains(unetwork, uprefix)\nlib/prefix.c"] --> B["Returns 1 if unetwork contains uprefix\n(prefixlen check + byte mask compare)"]
C["evpn_type5_prefix_contains(n, p)\nlib/prefix.c"] --> D["Returns 1 if n contains p\n(EVPN type-5 ip-prefix variant)"]
E[Callers - bgpd] --> A
F[Callers - zebra] --> A
G[Callers - ospfd/ospf6d] --> A
H[Callers - pimd/ripd/ldpd/nhrpd] --> A
I[Callers - isisd/staticd] --> A
J[Callers - lib filter/plist/table/if] --> A
K[bgpd/bgp_route.c] --> C
|
prefix_match is not really a great name for what it is doing. This function is actually checking that the first parameter contains the second parameter as a prefix. Let's name it something better such that people will auto know what it is doing immediately. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This is a network check to see if the first parameter contains the second parameter. Let's name it better. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
riw777
left a comment
There was a problem hiding this comment.
looks good ... the one ai comment seems valid
|
This seems like it might need to be fixed?
|
0dcdd2b to
b5ab7fc
Compare
Rename:
a) prefix_match to prefix_contains. This better encapsulates what this function is doing. I have to look up what this function does every time because the name does not make 100% sense to me. Let's name it better
b) evpn_type5_prefix_match to evpn_type5_prefix_contains. Same reasoning.