gateway: inline olsr_trigger_inetgw_selection function
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 22 Aug 2012 10:48:16 +0000 (12:48 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 24 Aug 2012 08:50:04 +0000 (10:50 +0200)
To simplify and reduce the number of functions

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
src/gateway.c

index 48e59d3..b467c9a 100644 (file)
@@ -124,19 +124,6 @@ static void smartgw_tunnel_monitor(int if_index __attribute__ ((unused)),
 }
 
 /**
- * Triggers an instant gateway selection based on the current data
- *
- * @param ipv4 trigger a ipv4 gateway lookup
- * @param ipv6 trigger a ipv6 gateway lookup
- * @return 0 if successful, -1 otherwise
- */
-static int olsr_trigger_inetgw_selection(bool ipv4, bool ipv6) {
-  assert(gw_handler);
-  gw_handler->choose(ipv4, ipv6);
-  return ((ipv4 && current_ipv4_gw == NULL) || (ipv6 && current_ipv6_gw == NULL)) ? -1 : 0;
-}
-
-/**
  * Timer callback to remove and cleanup a gateway entry
  *
  * @param ptr
@@ -471,7 +458,8 @@ void olsr_trigger_gatewayloss_check(void) {
   }
 
   if (ipv4 || ipv6) {
-    olsr_trigger_inetgw_selection(ipv4, ipv6);
+    assert(gw_handler);
+    gw_handler->choose(ipv4, ipv6);
   }
 }