X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=proto.c;h=eaec91325653da91a74f9f589f52b1f50b443157;hp=3a7b2a832348b801998c11acb8327adaeed29fd3;hb=944f30d3f96577464545dd35691f96b06fbcc6ab;hpb=3d317e90f15eec480b23f4dcddb841c292bef690 diff --git a/proto.c b/proto.c index 3a7b2a8..eaec913 100644 --- a/proto.c +++ b/proto.c @@ -270,6 +270,7 @@ parse_gateway_option(struct interface *iface, struct blob_attr *attr, bool v6) route->mask = 0; route->flags = (v6 ? DEVADDR_INET6 : DEVADDR_INET4); + route->metric = iface->metric; unsigned int table = (v6) ? iface->ip6table : iface->ip4table; if (table) { @@ -585,16 +586,20 @@ void proto_attach_interface(struct interface *iface, const char *proto_name) { const struct proto_handler *proto = &no_proto; + const char *error = NULL; if (proto_name) { proto = get_proto_handler(proto_name); if (!proto) { - interface_add_error(iface, "proto", "INVALID_PROTO", NULL, 0); + error = "INVALID_PROTO"; proto = &no_proto; } } iface->proto_handler = proto; + + if (error) + interface_add_error(iface, "proto", error, NULL, 0); } int