gateway: ignore zero bandwidth and uni-directional links
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 25 Jul 2012 16:30:09 +0000 (18:30 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 25 Jul 2012 19:24:25 +0000 (21:24 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/gateway_default_handler.c

index 6e99195..ec6225c 100644 (file)
@@ -64,6 +64,11 @@ static void gw_default_choose_gateway(void) {
       continue;
     }
 
+    if (!gw->uplink || !gw->downlink) {
+      /* do not consider nodes without bandwidth or with a uni-directional link */
+      continue;
+    }
+
     /* determine the path costs threshold */
     if (olsr_cnf->smart_gw_thresh == 0) {
       path_cost_times_threshold = tc->path_cost;