From a502295eaffcd5f6fb9e8fbaadf4fb5154537e94 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 12 Apr 2017 03:43:53 +0200
Subject: [PATCH] gluon-core: gluon_mesh: make transitive and fixed_mtu
 available as interface data, add post-setup.d

In addition, transitive and fixed_mtu now default to 0 instead of an empty string.
---
 .../files/lib/netifd/proto/gluon_mesh.sh           | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh b/package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh
index aaa24c843..e84e057c7 100755
--- a/package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh
+++ b/package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh
@@ -16,15 +16,25 @@ proto_gluon_mesh_setup() {
 	local fixed_mtu transitive
 	json_get_vars fixed_mtu transitive
 
-	export FIXED_MTU="$fixed_mtu"
-	export TRANSITIVE="$transitive"
+	export FIXED_MTU="${fixed_mtu:-0}"
+	export TRANSITIVE="${transitive:-0}"
 
 	for script in /lib/gluon/core/mesh/setup.d/*; do
 	        [ ! -x "$script" ] || "$script"
 	done
 
         proto_init_update "$IFNAME" 1
+
+	proto_add_data
+	json_add_boolean fixed_mtu "$FIXED_MTU"
+	json_add_boolean transitive "$TRANSITIVE"
+	proto_close_data
+
         proto_send_update "$CONFIG"
+
+	for script in /lib/gluon/core/mesh/post-setup.d/*; do
+	        [ ! -x "$script" ] || "$script"
+	done
 }
 
 proto_gluon_mesh_teardown() {
-- 
GitLab