conf: initialise sgw uplink & downlink before setting them
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 16 Nov 2015 14:33:17 +0000 (15:33 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 16 Nov 2015 14:33:51 +0000 (15:33 +0100)
Since the setters call set_smart_gateway_bandwidth_zero which
depends on both values being initialised.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/cfgparser/olsrd_conf.c

index bffb987..93287a3 100644 (file)
@@ -1146,6 +1146,8 @@ set_default_cnf(struct olsrd_config *cnf, char * configuration_file)
   cnf->smart_gw_divider_etx = DEF_GW_DIVIDER_ETX;
   cnf->smart_gw_path_max_cost_etx_max = DEF_GW_MAX_COST_MAX_ETX;
   cnf->smart_gw_type = DEF_GW_TYPE;
+  cnf->smart_gw_uplink = 0;
+  cnf->smart_gw_downlink = 0;
   smartgw_set_uplink(cnf, DEF_UPLINK_SPEED);
   smartgw_set_downlink(cnf, DEF_DOWNLINK_SPEED);
   // cnf->smart_gateway_bandwidth_zero : derived config set by smartgw_set_(up|down)link