From 39231150ad131018efccffe5176c888cb1300bab Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 27 May 2010 13:39:40 +0200 Subject: [PATCH] VTY: Fix segfault during 'write file' from vty This bug had been introduced by the recent switch to libosmovty --- openbsc/src/bsc_vty.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openbsc/src/bsc_vty.c b/openbsc/src/bsc_vty.c index ad49bd580..a55303bca 100644 --- a/openbsc/src/bsc_vty.c +++ b/openbsc/src/bsc_vty.c @@ -96,10 +96,19 @@ struct cmd_node ts_node = { 1, }; +extern struct gsm_network *bsc_gsmnet; + struct gsm_network *gsmnet_from_vty(struct vty *v) { + /* In case we read from the config file, the vty->priv cannot + * point to a struct telnet_connection, and thus conn->priv + * will not point to the gsm_network structure */ +#if 0 struct telnet_connection *conn = v->priv; return (struct gsm_network *) conn->priv; +#else + return bsc_gsmnet; +#endif } static int dummy_config_write(struct vty *v)