tools: Normalize aggregate-address command when doing frr-reload#22284
tools: Normalize aggregate-address command when doing frr-reload#22284ton31337 wants to merge 1 commit into
Conversation
Without this if we swap the parameters in frr.conf and show running shows the order differently, the route is re-added which means a short hole. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Greptile SummaryThis PR adds a
Confidence Score: 4/5Safe to merge; the normalization is additive and falls back to returning the original line for any unrecognized input. The canonical keyword order produced by the new function matches exactly what bgpd's bgp_config_write_network outputs (confirmed in bgpd/bgp_route.c). The regex correctly handles both CIDR and legacy A.B.C.D A.B.C.D prefix notation, all six valid keywords are covered, and the else-return-line guard means any future keyword addition degrades gracefully. tools/frr-reload.py — specifically the prefix-capture regex in get_normalized_aggregate_address_line; verified correct but slightly subtle. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[line starts with 'aggregate-address '] --> B[regex match prefix + rest]
B -- no match --> C[return line unchanged]
B -- match --> D[tokenize rest into list]
D --> E{for each token}
E -- as-set --> F[as_set = True]
E -- summary-only --> G[summary_only = True]
E -- matching-MED-only --> H[match_med = True]
E -- route-map --> I[consume next token as route_map]
E -- origin --> J[consume next token as origin]
E -- suppress-map --> K[consume next token as suppress_map]
E -- unknown token --> C
F & G & H & I & J & K --> E
E -- done --> L[build canonical string]
L --> M[return normalized line]
Reviews (1): Last reviewed commit: "tools: Normalize aggregate-address comma..." | Re-trigger Greptile |
|
@Mergifyio backport stable/10.7 |
🟠 Waiting for conditions to matchDetails
|
No description provided.