Attention is currently required from: laforge, pespin, fixeria.
neels uploaded patch set #2 to this change.
vty: show bug in implicit go_parent_node
Add test to show a problem in VTY node exiting.
Back in 2017 when I introduced VTY config file scopes by indenting [1],
I actually mistook the vty->priv for the vty->index that we use
everywhere to link to the state for our VTY nodes.
The intention was that each VTY node child level has its own object
linked to it by the vty->index pointer. When the config file leaves a
scope, the vty->index should reflect the parent object.
Instead I implemented that for the vty->priv pointer only, but we don't
use that.
Why did this bug not show? A problem happens only if:
- a node that uses vty->index is nested inside a node that also uses
vty->index.
- config sets parent node attributes after a child node.
- there is no legacy vty_go_parent() function that sets the correct
index via a switch().
[1]
"VTY: implicit node exit by de-indenting, not parent lookup"
4a31ffa2f0097d96201f80305a0495c57552f0ad
I24cbb3f6de111f2d31110c3c484c066f1153aac9
Change-Id: I2472daed7436a1947655b06d34eb217e595bc7f3
---
M tests/vty/vty_transcript_test.c
M tests/vty/vty_transcript_test.vty
2 files changed, 138 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/32561/2
To view, visit change 32561. To unsubscribe, or for help writing mail filters, visit settings.