summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
Diffstat (limited to 'nest')
-rw-r--r--nest/cli.c11
-rw-r--r--nest/cli.h4
-rw-r--r--nest/rt-show.c1
3 files changed, 11 insertions, 5 deletions
diff --git a/nest/cli.c b/nest/cli.c
index 469d45b6..1debfccf 100644
--- a/nest/cli.c
+++ b/nest/cli.c
@@ -307,14 +307,14 @@ cli_event(void *data)
}
cli *
-cli_new(void *priv)
+cli_new(struct birdsock *sock)
{
pool *p = rp_new(cli_pool, "CLI");
cli *c = mb_alloc(p, sizeof(cli));
bzero(c, sizeof(cli));
c->pool = p;
- c->priv = priv;
+ c->sock = sock;
c->event = ev_new(p);
c->event->hook = cli_event;
c->event->data = c;
@@ -415,7 +415,12 @@ cli_free(cli *c)
if (c == cmd_reconfig_stored_cli)
cmd_reconfig_stored_cli = NULL;
- if (!defer)
+ if (defer)
+ {
+ rfree(c->sock);
+ c->sock = NULL;
+ }
+ else
rfree(c->pool);
}
diff --git a/nest/cli.h b/nest/cli.h
index 92572968..2b96da5b 100644
--- a/nest/cli.h
+++ b/nest/cli.h
@@ -28,7 +28,7 @@ struct cli_out {
typedef struct cli {
node n; /* Node in list of all log hooks */
pool *pool;
- void *priv; /* Private to sysdep layer */
+ struct birdsock *sock; /* Underlying socket */
byte *rx_buf, *rx_pos, *rx_aux; /* sysdep */
struct cli_out *tx_buf, *tx_pos, *tx_write;
event *event;
@@ -63,7 +63,7 @@ static inline void cli_separator(cli *c)
/* Functions provided to sysdep layer */
-cli *cli_new(void *);
+cli *cli_new(struct birdsock *);
void cli_init(void);
void cli_free(cli *);
void cli_kick(cli *);
diff --git a/nest/rt-show.c b/nest/rt-show.c
index dc88047a..d8eb2174 100644
--- a/nest/rt-show.c
+++ b/nest/rt-show.c
@@ -233,6 +233,7 @@ static int
rt_show_cleanup(struct cli *c)
{
struct rt_show_data *d = c->rover;
+ c->cleanup = NULL;
/* Cancel the feed */
if (d->req.hook)