Skip to content

Conversation

@raja-rajasekar
Copy link
Contributor

increasing vtysh cli length constraint

If we have 150 large communities using maximum-sized values, we exceed 4096 bytes (4,770 bytes).. Fixing this

4294967295:4294967295:4294967150
% Command is too long.
% [BGP] Unknown command: 67295:4294967124 4294967295:4294967295:4294967125 4294967295:4294967295:4294967126 4294967295:4294967295:4294967127 4294967295:4294967295:4294967128 4294967295:4294967295:4294967129 4294967295:4294967295:4294967130 4294967295:4294967295:4294967131 4294967295:4294967295:4294967132 4294967295:4294967295:4294967133 4294967295:4294967295:429496

@frrbot frrbot bot added bgp libfrr tests Topotests, make check, etc labels Nov 21, 2025
@raja-rajasekar raja-rajasekar force-pushed the rajasekarr/cli_limit branch 2 times, most recently from a574f97 to 7977800 Compare November 21, 2025 22:41

step("Configuring route-map with 150 large communities (~4770 bytes)")
router = tgen.gears["r1"]
cmd = "configure terminal\n"
Copy link
Member

Choose a reason for hiding this comment

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

Please use f-string, e.g.:

output = router.vtysh_cmd(
"""
configure terminal
route-map LARGE_COMM_150 permit 10
set large-community {large_comm_str}
""")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

lib/vty.c Outdated
/* Clear command line buffer. */
vty->cp = vty->length = 0;
vty_clear_buf(vty);
flog_err(EC_LIB_VTY, "Command too long: %.*s", nbytes, buf);
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm - is it necessary to spam the log with the entire buffer? if you think adding an error would be useful, maybe just emit the start of the command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

now we would see 80chars and something like
2025/11/24 18:36:45 BGP: [VNXE7-TGXN3][EC 100663304] Command too long (512 bytes): 4967295:4294967031 4294967295:4294967295:4294967032 4294967295:4294967295:429496...

Adding flog_err to log the error when
the cli entered by user exceeds 8k limit

We would see something like
2025/11/24 18:36:45 BGP: [VNXE7-TGXN3][EC 100663304] Command too long (XYZ bytes): 4967295:4294967031 4294967295:4294967295:4294967032 4294967295:4294967295:429496...

Signed-off-by: Manpreet Kaur <[email protected]>

Signed-off-by: Rajasekar Raja <[email protected]>
Test that 150 large communities with max-sized values can be
configured in a route-map, exceeding the old 4096 byte limit
and requiring the 8192 byte buffer increase.

Signed-off-by: Rajasekar Raja <[email protected]>
@raja-rajasekar
Copy link
Contributor Author

ci:rerun

@raja-rajasekar
Copy link
Contributor Author

ci:rerun

1 similar comment
@raja-rajasekar
Copy link
Contributor Author

ci:rerun

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants