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 9bdad4fd32ca9b31015b5d1c491acd0cfb6643c9..2088937b3cfe6479aa84f5a45feb2feffae9ffd2 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);