linux: do not try to set routes with negative metric
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 13 Aug 2014 10:03:44 +0000 (12:03 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 19 Aug 2014 07:38:19 +0000 (09:38 +0200)
Makes no sense.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/linux/kernel_routes_nl.c

index 5f87989..025037d 100644 (file)
@@ -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));
   }