From d705cf864be96104996be164e7a6a052dcec555c Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Tue, 26 Jul 2016 22:41:18 +0200 Subject: [PATCH] shell ccn-lite: check for max ifcount --- sys/shell/commands/sc_ccnl.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/shell/commands/sc_ccnl.c b/sys/shell/commands/sc_ccnl.c index da4a604644..d4cad3ff5a 100644 --- a/sys/shell/commands/sc_ccnl.c +++ b/sys/shell/commands/sc_ccnl.c @@ -39,9 +39,6 @@ static unsigned char _cont_buf[BUF_SIZE]; static const char *_default_content = "Start the RIOT!"; static unsigned char _out[CCNL_MAX_PACKET_SIZE]; -/* check for one-time initialization */ -static bool started = false; - /* usage for open command */ static void _open_usage(void) { @@ -51,8 +48,8 @@ static void _open_usage(void) int _ccnl_open(int argc, char **argv) { /* check if already running */ - if (started) { - puts("Already opened an interface for CCN!"); + if (ccnl_relay.ifcount >= CCNL_MAX_INTERFACES) { + puts("Already opened max. number of interfaces for CCN!"); return -1; } @@ -78,8 +75,6 @@ int _ccnl_open(int argc, char **argv) return -1; } - started = true; - return 0; }