X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=scripts%2Fnetifd-proto.sh;h=447f0f660f2c099654940801e0a2e5c650769df1;hp=2a62bda8e213e71fa641866cafdace9585c127f4;hb=a7e508b71c1cf3ee9d401510d298195067fba8e5;hpb=2fb3d0e9205e2a4cea38062caefd7251f562866d diff --git a/scripts/netifd-proto.sh b/scripts/netifd-proto.sh index 2a62bda..447f0f6 100644 --- a/scripts/netifd-proto.sh +++ b/scripts/netifd-proto.sh @@ -121,8 +121,9 @@ proto_add_ipv4_route() { local mask="$2" local gw="$3" local source="$4" + local metric="$5" - append PROTO_ROUTE "$target/$mask/$gw///$source/" + append PROTO_ROUTE "$target/$mask/$gw/$metric///$source" } proto_add_ipv6_route() { @@ -134,7 +135,7 @@ proto_add_ipv6_route() { local source="$6" local table="$7" - append PROTO_ROUTE6 "$target/$mask/$gw/$metric/$valid/$source/$table" + append PROTO_ROUTE6 "$target/$mask/$gw/$metric/$valid/$table/$source" } proto_add_ipv6_prefix() { @@ -212,9 +213,9 @@ _proto_push_route() { str="${str#*/}" local valid="${str%%/*}" str="${str#*/}" - local source="${str%%/*}" + local table="${str%%/*}" str="${str#*/}" - local table="${str}" + local source="${str}" json_add_object "" json_add_string target "$target" @@ -361,6 +362,7 @@ init_proto() { dump) add_protocol() { no_device=0 + no_proto_task=0 available=0 renew_handler=0 @@ -372,8 +374,10 @@ init_proto() { eval "proto_$1_init_config" json_close_array json_add_boolean no-device "$no_device" + json_add_boolean no-proto-task "$no_proto_task" json_add_boolean available "$available" json_add_boolean renew-handler "$renew_handler" + json_add_boolean lasterror "$lasterror" json_dump } ;;