ospfd: accept value with no maximum-paths - #22880
Conversation
Allow no maximum-paths to accept an optional value. Reset the setting only when the value matches the configured maximum paths. Use DEFPY to handle the optional argument. Ticket: #5140314 Testing: Before: mlx-4600-05(config)# router ospf mlx-4600-05(config-router)# no maximum-paths 13 % Unknown command: no maximum-paths 13 After: mlx-4600-05(config)# router ospf mlx-4600-05(config-router)# no maximum-paths 13 mlx-4600-05(config-router)# Signed-off-by: Vijayalaxmi Basavaraj <vbasavaraj@nvidia.com>
| DEFPY (no_ospf_max_multipath, | ||
| no_ospf_max_multipath_cmd, | ||
| "no maximum-paths [" CMD_RANGE_STR(1, MULTIPATH_NUM)"]", | ||
| "no maximum-paths [(1-128)$maxpaths]", |
There was a problem hiding this comment.
When FRR is built with MULTIPATH_NUM above 128, the positive command accepts configured values above 128 but this no-form rejects those same values as unknown commands, preventing value-bearing removal of a valid configuration.
Prompt To Fix With AI
This is a comment left during a code review.
Path: ospfd/ospf_vty.c
Line: 2942
Comment:
**Hard-coded no-form range**
When FRR is built with `MULTIPATH_NUM` above 128, the positive command accepts configured values above 128 but this no-form rejects those same values as unknown commands, preventing value-bearing removal of a valid configuration.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Greptile SummaryThis PR extends OSPF's
Confidence Score: 4/5The parser range mismatch should be fixed before merging because supported builds can configure values that the new value-bearing no-form cannot remove. The positive command accepts values up to the configurable Files Needing Attention: ospfd/ospf_vty.c Important Files Changed
Prompt To Fix All With AI### Issue 1
ospfd/ospf_vty.c:2942
**Hard-coded no-form range**
When FRR is built with `MULTIPATH_NUM` above 128, the positive command accepts configured values above 128 but this no-form rejects those same values as unknown commands, preventing value-bearing removal of a valid configuration.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "ospfd: accept value with no maximum-path..." | Re-trigger Greptile |
Allow no maximum-paths to accept an optional value.
Reset the setting only when the value matches the configured maximum paths.
Use DEFPY to handle the optional argument.
Testing:
Before:
mlx-4600-05(config)# router ospf
mlx-4600-05(config-router)# no maximum-paths 13
% Unknown command: no maximum-paths 13
After:
mlx-4600-05(config)# router ospf
mlx-4600-05(config-router)# no maximum-paths 13
mlx-4600-05(config-router)#