Change the calling order mesh_gdbus_set_mesh_gate and mesh_request_set_mesh_gate...
authorsaerome.kim <saerome.kim@samsung.com>
Mon, 3 Jul 2017 12:53:18 +0000 (21:53 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 17 Jul 2017 02:35:37 +0000 (11:35 +0900)
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
src/mesh-service-interface.c

index 192b225..e272cdf 100644 (file)
@@ -556,16 +556,17 @@ static gboolean _meshd_dbus_handle_set_gate(NetMesh *object,
        info->hwmp_root_mode = hwmp_root_mode;
        info->stp = stp;
 
+       /* Set STP and gate_announce for connmand */
+       ret = mesh_gdbus_set_mesh_gate(service);
+       if (MESHD_ERROR_NONE != ret)
+               MESH_LOGE("Failed to mesh_gdbus_set_mesh_gate [%d]", ret);
+
        /* Set STP and gate_announce right now */
        ret = mesh_request_set_mesh_gate(info->bridge_interface,
                        info->mesh_interface, info->external_interface);
        if (MESHD_ERROR_NONE != ret)
                MESH_LOGE("Failed to mesh_gdbus_set_mesh_gate [%d]", ret);
 
-       /* Set STP and gate_announce for connmand */
-       ret = mesh_gdbus_set_mesh_gate(service);
-       if (MESHD_ERROR_NONE != ret)
-               MESH_LOGE("Failed to mesh_gdbus_set_mesh_gate [%d]", ret);
 
        net_mesh_complete_set_gate(object, invocation, ret);
 
@@ -584,17 +585,17 @@ static gboolean _meshd_dbus_handle_unset_gate(NetMesh *object,
        info->hwmp_root_mode = 0;
        info->stp = 0;
 
+       /* Set STP and gate_announce for connmand */
+       ret = mesh_gdbus_set_mesh_gate(service);
+       if (MESHD_ERROR_NONE != ret)
+               MESH_LOGE("Failed to mesh_gdbus_set_mesh_gate [%d]", ret);
+
        /* Unset STP and Gate Annouce right now */
        ret = mesh_request_unset_mesh_gate(info->bridge_interface,
                        info->mesh_interface, info->external_interface);
        if (MESHD_ERROR_NONE != ret)
                MESH_LOGE("Failed to mesh_request_unset_mesh_gate [%d]", ret);
 
-       /* Set STP and gate_announce for connmand */
-       ret = mesh_gdbus_set_mesh_gate(service);
-       if (MESHD_ERROR_NONE != ret)
-               MESH_LOGE("Failed to mesh_gdbus_set_mesh_gate [%d]", ret);
-
        net_mesh_complete_unset_gate(object, invocation, ret);
 
        return TRUE;