Skip to content

ospfd: accept value with no maximum-paths - #22880

Open
chiragshah6 wants to merge 1 commit into
FRRouting:masterfrom
chiragshah6:ospf_dev1
Open

ospfd: accept value with no maximum-paths#22880
chiragshah6 wants to merge 1 commit into
FRRouting:masterfrom
chiragshah6:ospf_dev1

Conversation

@chiragshah6

Copy link
Copy Markdown
Member

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)#

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>
Comment thread ospfd/ospf_vty.c
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]",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

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-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Greptile Summary

This PR extends OSPF's no maximum-paths command with an optional value.

  • Converts the no-form from DEFUN to DEFPY.
  • Resets the setting only when the optional value matches the configured maximum.
  • Continues to reset an unqualified no maximum-paths command to the build-time default.

Confidence Score: 4/5

The 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 MULTIPATH_NUM, while the changed no-form rejects every value above 128 before its matching logic can run.

Files Needing Attention: ospfd/ospf_vty.c

Important Files Changed

Filename Overview
ospfd/ospf_vty.c Adds value-sensitive removal semantics, but the new hard-coded parser range is narrower than the supported build-dependent range.
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants