[Olsr-dev] [PATCH v1 11/19] gateway: inline olsr_trigger_inetgw_selection function

Ferry Huberts (spam-protected)
Thu Aug 23 15:12:35 CEST 2012


From: Ferry Huberts <(spam-protected)>

To simplify and reduce the number of functions

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 src/gateway.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/gateway.c b/src/gateway.c
index 48e59d3..b467c9a 100644
--- a/src/gateway.c
+++ b/src/gateway.c
@@ -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);
   }
 }
 
-- 
1.7.11.4





More information about the Olsr-dev mailing list