sgwdynspeed: make sure to update the smart gw netmask
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 21 Aug 2012 13:05:36 +0000 (15:05 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 21 Aug 2012 13:06:59 +0000 (15:06 +0200)
when the uplink and/or downlink speeds change, because the smart gw
netmask carries the uplink and downlink speeds that are advertised
to other nodes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/sgwdynspeed/src/speedFile.c

index 69f461d..2c7a98c 100644 (file)
@@ -5,6 +5,7 @@
 
 /* OLSRD includes */
 #include "olsr_cfg.h"
+#include "gateway.h"
 
 /* System includes */
 #include <stddef.h>
@@ -229,6 +230,9 @@ void readSpeedFile(char * fileName) {
        if (downlinkSet) {
                olsr_cnf->smart_gw_downlink = downlink;
        }
+       if (uplinkSet || downlinkSet) {
+         refresh_smartgw_netmask();
+       }
 
        out: return;
 }