gateway: initialise the handler before setting up the tunnel
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 18 Oct 2012 09:16:54 +0000 (11:16 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 24 Oct 2012 12:17:49 +0000 (14:17 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/gateway.c

index 99c191f..17eeefa 100644 (file)
@@ -164,16 +164,16 @@ int olsr_init_gateways(void) {
 
   refresh_smartgw_netmask();
 
+  /* initialize default gateway handler */
+  gw_handler = &gw_def_handler;
+  gw_handler->init();
+
   if (olsr_os_init_iptunnel(olsr_cnf->ip_version == AF_INET ? TUNNEL_ENDPOINT_IF : TUNNEL_ENDPOINT_IF6)) {
     return 1;
   }
 
   olsr_add_ifchange_handler(smartgw_tunnel_monitor);
 
-  /* initialize default gateway handler */
-  gw_handler = &gw_def_handler;
-  gw_handler->init();
-
   return 0;
 }