main: separate shutdown and cleanup up gateways
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 23 May 2016 10:33:38 +0000 (12:33 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 23 May 2016 10:48:59 +0000 (12:48 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/main.c

index c978808..3924c50 100644 (file)
@@ -220,10 +220,8 @@ static void olsr_shutdown(int signo __attribute__ ((unused)))
   olsr_scheduler_stop();
 
 #ifdef __linux__
-  /* trigger gateway selection */
   if (olsr_cnf->smart_gw_active) {
     olsr_shutdown_gateways();
-    olsr_cleanup_gateways();
   }
 #endif
 
@@ -251,6 +249,12 @@ static void olsr_shutdown(int signo __attribute__ ((unused)))
 
   olsr_delete_all_mid_entries();
 
+#ifdef __linux__
+  if (olsr_cnf->smart_gw_active) {
+    olsr_cleanup_gateways();
+  }
+#endif
+
 #ifdef __linux__
   /* trigger niit static route cleanup */
   if (olsr_cnf->use_niit) {