initialize route->metric to -1
authorFelix Fietkau <nbd@openwrt.org>
Wed, 15 Feb 2012 17:30:25 +0000 (18:30 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 15 Feb 2012 17:30:25 +0000 (18:30 +0100)
interface-ip.c

index 9bdad4f..2088937 100644 (file)
@@ -94,6 +94,8 @@ interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6)
 
        if ((cur = tb[ROUTE_METRIC]) != NULL)
                route->metric = blobmsg_get_u32(cur);
+       else
+               route->metric = -1;
 
        if ((cur = tb[ROUTE_MTU]) != NULL)
                route->mtu = blobmsg_get_u32(cur);