Project

General

Profile

Bug #5029

vty: optional cases with multiple arguments is undefined behaviour

Added by lynxis 19 days ago. Updated 17 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
libosmovty
Target version:
-
Start date:
02/16/2021
Due date:
% Done:

0%

Spec Reference:

Description

E.g.

DEFUN(cfg_ns_nse_nsvc_udp, cfg_ns_nse_nsvc_udp_cmd, "nsvc udp BIND " VTY_IPV46_CMD " <1-65535> [signalling-weight <0-254> data-weight <0-254>]" 

results in an autocomplete of "[signalling-weigh". The missing t. However data-weight is ok again.
The follow patch with patchset 9 is showing this bug. https://gerrit.osmocom.org/c/libosmocore/+/22900/9/

History

#1 Updated by fixeria 18 days ago

I also faced this issue some time ago. The parser basically fails to handle constructions like:

command foo [zoo <0-123>]

so the only way (unless it's fixed) is to define two commands: with and without the optional part.

#2 Updated by pespin 17 days ago

I think the cases you mention here are simply not supported, and I'm not sure if we want to support them (I'm not saying I'm against it).
In any case, I see it is strange cmd parsing doesn't fail currently if no "]" is find at the end of the param.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)