[Olsr-dev] [PATCH v1 4/8] linux: do not try to set routes with negative metric

Ferry Huberts (spam-protected)
Tue Aug 19 12:07:48 CEST 2014


From: Ferry Huberts <(spam-protected)>

Makes no sense.

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 src/linux/kernel_routes_nl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/linux/kernel_routes_nl.c b/src/linux/kernel_routes_nl.c
index 5f87989..025037d 100644
--- a/src/linux/kernel_routes_nl.c
+++ b/src/linux/kernel_routes_nl.c
@@ -412,7 +412,7 @@ static int olsr_new_netlink_route(unsigned char family, uint32_t rttable, int if
     olsr_netlink_addreq(&req.n, sizeof(req), RTA_PREFSRC, src, family_size);
   }
 
-  if (metric != -1) {
+  if (metric >= 0) {
     /* add metric */
     olsr_netlink_addreq(&req.n, sizeof(req), RTA_PRIORITY, &metric, sizeof(metric));
   }
-- 
1.9.3





More information about the Olsr-dev mailing list