network/config/xfrm: add host-dependency for xfrm interface parent
authorAndré Valentin <avalentin@marcant.net>
Fri, 14 Jun 2019 11:09:47 +0000 (13:09 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Sat, 15 Jun 2019 11:41:39 +0000 (13:41 +0200)
Add proto_add_host_dependency to add a dependency to the tunlink interface

Signed-off-by: André Valentin <avalentin@marcant.net>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
package/network/config/xfrm/Makefile
package/network/config/xfrm/files/xfrm.sh

index efc90cf318cc53f5ff4db7711ed23889b2337d83..2afbd48a4fcb0c3e6406ee75da2bd4fd5df668be 100644 (file)
@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xfrm
 PKG_VERSION:=1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index df28d38613a52501231a923082596cff175e10ee..1bd1958726deaa0e83a2d659c264ff537bc7a967 100755 (executable)
@@ -14,24 +14,28 @@ 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