-
Notifications
You must be signed in to change notification settings - Fork 1.4k
increasing vtysh cli length constraint #20110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
increasing vtysh cli length constraint #20110
Conversation
a574f97 to
7977800
Compare
|
|
||
| step("Configuring route-map with 150 large communities (~4770 bytes)") | ||
| router = tgen.gears["r1"] | ||
| cmd = "configure terminal\n" |
There was a problem hiding this comment.
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}
""")There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
7977800 to
45c6a7f
Compare
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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...
Signed-off-by: Manpreet Kaur <[email protected]>
45c6a7f to
3cad9a6
Compare
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]>
3cad9a6 to
5d3e23f
Compare
|
ci:rerun |
|
ci:rerun |
1 similar comment
|
ci:rerun |
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