Message ID | 20190614110947.10540-4-avalentin@marcant.net |
---|---|
State | Accepted |
Delegated to: | Hans Dedecker |
Headers | show |
Series | None | expand |
On Fri, Jun 14, 2019 at 1:10 PM André Valentin <avalentin@marcant.net> wrote: > > Add proto_add_host_dependency to add a dependency to the tunlink interface > > Signed-off-by: André Valentin <avalentin@marcant.net> Patch pushed to master; thx Hans > --- > package/network/config/xfrm/files/xfrm.sh | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/package/network/config/xfrm/files/xfrm.sh b/package/network/config/xfrm/files/xfrm.sh > index df28d38613..4711bf2f55 100755 > --- a/package/network/config/xfrm/files/xfrm.sh > +++ b/package/network/config/xfrm/files/xfrm.sh > @@ -14,24 +14,27 @@ proto_xfrm_setup() { > local tunlink ifid mtu zone > json_get_vars tunlink ifid mtu zone > > - proto_init_update "$cfg" 1 > - > - proto_add_tunnel > - json_add_string mode "$mode" > - json_add_int mtu "${mtu:-1280}" > - > [ -z "$tunlink" ] && { > proto_notify_error "$cfg" NO_TUNLINK > proto_block_restart "$cfg" > exit > } > - json_add_string link "$tunlink" > - > [ -z "$ifid" ] && { > proto_notify_error "$cfg" NO_IFID > proto_block_restart "$cfg" > exit > } > + > + ( proto_add_host_dependency "$cfg" '' "$tunlink" ) > + > + proto_init_update "$cfg" 1 > + > + proto_add_tunnel > + json_add_string mode "$mode" > + json_add_int mtu "${mtu:-1280}" > + > + json_add_string link "$tunlink" > + > json_add_object 'data' > [ -n "$ifid" ] && json_add_int ifid "$ifid" > json_close_object > -- > 2.11.0 > > > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff --git a/package/network/config/xfrm/files/xfrm.sh b/package/network/config/xfrm/files/xfrm.sh index df28d38613..4711bf2f55 100755 --- a/package/network/config/xfrm/files/xfrm.sh +++ b/package/network/config/xfrm/files/xfrm.sh @@ -14,24 +14,27 @@ proto_xfrm_setup() { local tunlink ifid mtu zone json_get_vars tunlink ifid mtu zone - proto_init_update "$cfg" 1 - - proto_add_tunnel - json_add_string mode "$mode" - json_add_int mtu "${mtu:-1280}" - [ -z "$tunlink" ] && { proto_notify_error "$cfg" NO_TUNLINK proto_block_restart "$cfg" exit } - json_add_string link "$tunlink" - [ -z "$ifid" ] && { proto_notify_error "$cfg" NO_IFID proto_block_restart "$cfg" exit } + + ( proto_add_host_dependency "$cfg" '' "$tunlink" ) + + proto_init_update "$cfg" 1 + + proto_add_tunnel + json_add_string mode "$mode" + json_add_int mtu "${mtu:-1280}" + + json_add_string link "$tunlink" + json_add_object 'data' [ -n "$ifid" ] && json_add_int ifid "$ifid" json_close_object
Add proto_add_host_dependency to add a dependency to the tunlink interface Signed-off-by: André Valentin <avalentin@marcant.net> --- package/network/config/xfrm/files/xfrm.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)