sgwdynspeed: only allow the plugin in single-sgw mode
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 15 Aug 2014 10:51:19 +0000 (12:51 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 12 Nov 2014 10:45:25 +0000 (11:45 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/sgwdynspeed/src/sgwDynSpeed.c

index 28f6a2a..b780e36 100644 (file)
@@ -8,6 +8,8 @@
 #include "olsr.h"
 #include "olsr_cookie.h"
 #include "scheduler.h"
+#include "log.h"
+#include "gateway.h"
 
 /* System includes */
 
@@ -78,6 +80,11 @@ static struct timer_entry * smartgw_speed_file_timer = NULL;
  */bool initSgwDynSpeed(void) {
        char * speedFile;
 
+       if (multi_gateway_mode()) {
+         olsr_syslog(OLSR_LOG_ERR, "sgwDynSpeed plugin can't be enabled in multi-smart-gateway mode");
+         return false;
+       }
+
        if (!startSpeedFile()) {
                return false;
        }