sgw: optimise iptables rule ordering
authorFerry Huberts <ferry.huberts@pelagic.nl>
Sat, 28 May 2016 21:33:01 +0000 (23:33 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Sat, 28 May 2016 21:37:13 +0000 (23:37 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/gateway.c

index 847593a..eb6a0f5 100644 (file)
@@ -911,11 +911,11 @@ int olsr_startup_gateways(void) {
   }
 
   ok = ok && multiGwRulesCleanup(true);
-  ok = ok && multiGwRulesGeneric(true);
-  ok = ok && multiGwRulesSgwServerTunnel(true);
   ok = ok && multiGwRulesOlsrInterfaces(true);
-  ok = ok && multiGwRulesEgressInterfaces(true);
   ok = ok && multiGwRulesSgwTunnels(true);
+  ok = ok && multiGwRulesEgressInterfaces(true);
+  ok = ok && multiGwRulesSgwServerTunnel(true);
+  ok = ok && multiGwRulesGeneric(true);
   if (!ok) {
     olsr_printf(0, "Could not setup multi-gateway iptables and ip rules\n");
     olsr_shutdown_gateways();
@@ -992,11 +992,11 @@ void olsr_shutdown_gateways(void) {
   }
   doRoutesMultiGw(true, false, GW_MULTI_CHANGE_PHASE_SHUTDOWN);
 
-  (void)multiGwRulesSgwTunnels(false);
+  (void)multiGwRulesGeneric(false);
+  (void)multiGwRulesSgwServerTunnel(false);
   (void)multiGwRulesEgressInterfaces(false);
+  (void)multiGwRulesSgwTunnels(false);
   (void)multiGwRulesOlsrInterfaces(false);
-  (void)multiGwRulesSgwServerTunnel(false);
-  (void)multiGwRulesGeneric(false);
   (void)multiGwRulesCleanup(false);
 }