[Olsr-dev] [olsrd] [PATCH v2 33/33] pud: ignore zero bandwidth/uni-directional link gateways
Ferry Huberts
(spam-protected)
Wed Jul 25 21:29:40 CEST 2012
From: Ferry Huberts <(spam-protected)>
Signed-off-by: Ferry Huberts <(spam-protected)>
---
lib/pud/src/uplinkGateway.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/pud/src/uplinkGateway.c b/lib/pud/src/uplinkGateway.c
index 068c86d..9ff91f2 100644
--- a/lib/pud/src/uplinkGateway.c
+++ b/lib/pud/src/uplinkGateway.c
@@ -45,12 +45,18 @@ void getBestUplinkGateway(union olsr_ip_addr * bestGateway) {
bool eval6 = false;
struct tc_entry * tc = olsr_lookup_tc_entry(&gw->originator);
- if (tc == NULL) {
+ if (!tc) {
+ /* gateways should not exist without tc entry */
continue;
}
- /* do not consider nodes with an infinite ETX */
if (tc->path_cost == ROUTE_COST_BROKEN) {
+ /* do not consider nodes with an infinite ETX */
+ continue;
+ }
+
+ if (!gw->uplink || !gw->downlink) {
+ /* do not consider nodes without bandwidth or with a uni-directional link */
continue;
}
--
1.7.11.2
More information about the Olsr-dev
mailing list