[PATCH 3/6] vty: Generalize ournode_exit() and ournode_end()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Sat Aug 31 13:47:56 UTC 2013


On Fri, Aug 30, 2013 at 06:34:00PM +0200, Jacob Erlbeck wrote:

> Note that in config mode if the tree is searched along the nodes
> toward the config node and a command is not found this way, a
> rollback is done by just replacing the vty's node and index member
> variable by the saved old values which might break the whole thing, when
> there has been a free() on the way.

okay, but in this case the config parsing will fail too. So right
now we should be safe. Thanks for looking into this!
o

> @@ -186,36 +130,24 @@ gDEFUN(ournode_exit,
>  gDEFUN(ournode_end,
>         ournode_end_cmd, "end", "End current mode and change to enable mode.")
>  {
> +	if (vty->node >= CONFIG_NODE) {


this would be true for the OM2K node, which is not a configure node.
Can you elaborate why not using the 'is config node' predicate is not
necessary?

>      def _testConfigNetworkTree(self):
>          self.vty.enable()
> -        self.vty.verify("configure terminal",[''])
> +        self.assertTrue(self.vty.verify("configure terminal",['']))

where is the change from self.vty.verify to self assertTrue coming
from? is this related to your change?





More information about the OpenBSC mailing list