From: Jiwan Kim Date: Wed, 14 Jun 2017 06:37:47 +0000 (+0900) Subject: Fix for UTC error case X-Git-Tag: accepted/tizen/unified/20170829.053204~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=3e7951a874eac322fc5d9eaa8cea047361a77b0b;p=platform%2Fcore%2Fconnectivity%2Fwifi-mesh-manager.git Fix for UTC error case - Add privileges (not fully tested) - Fix mesh_request_set_mesh_gate() - Fix not to return error code on repeated enable() --- diff --git a/packaging/dbus-meshd.conf b/packaging/dbus-meshd.conf index 3cb7eac..084796b 100644 --- a/packaging/dbus-meshd.conf +++ b/packaging/dbus-meshd.conf @@ -3,10 +3,62 @@ + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packaging/meshd.spec b/packaging/meshd.spec index 337b967..801908b 100644 --- a/packaging/meshd.spec +++ b/packaging/meshd.spec @@ -67,6 +67,9 @@ cp meshd.service %{buildroot}%{_unitdir}/meshd.service %post chmod 755 %{_sbindir}/mesh.sh +# For configuration files +mkdir -p %TZ_SYS_VAR/lib/mesh + %files %manifest meshd.manifest %license LICENSE diff --git a/src/mesh-request.c b/src/mesh-request.c index 1acfc3b..a15a264 100644 --- a/src/mesh-request.c +++ b/src/mesh-request.c @@ -45,30 +45,27 @@ int mesh_request_set_mesh_gate(const char* bridge_interface, MESH_LOGE("Failed to get external interface state !"); return MESHD_ERROR_OPERATION_FAILED; } + MESH_LOGD(" Ethernet cable state [%s]", + (state) ? "Connected" : "Disconnected"); - if (state) { - /* Turn STP on */ - ret = mesh_bridge_set_stp(bridge_interface, TRUE); - if (MESHD_ERROR_NONE != ret) { - MESH_LOGE("Failed to turn STP on !"); - return ret; - } - - /* Set mesh parameters */ - ret = mesh_netlink_set_mesh_parameter(mesh_interface, - "mesh_hwmp_rootmode", 4); - if (MESHD_ERROR_NONE != ret) - MESH_LOGE("Failed to set [mesh_hwmp_rootmode] : 4"); - - ret = mesh_netlink_set_mesh_parameter(mesh_interface, - "mesh_gate_announcements", 1); - if (MESHD_ERROR_NONE != ret) - MESH_LOGE("Failed to set [mesh_gate_announcements] : 1"); - } else { - MESH_LOGE("External interface is not available !"); - return MESHD_ERROR_OPERATION_FAILED; + /* Turn STP on */ + ret = mesh_bridge_set_stp(bridge_interface, TRUE); + if (MESHD_ERROR_NONE != ret) { + MESH_LOGE("Failed to turn STP on !"); + return ret; } + /* Set mesh parameters */ + ret = mesh_netlink_set_mesh_parameter(mesh_interface, + "mesh_hwmp_rootmode", 4); + if (MESHD_ERROR_NONE != ret) + MESH_LOGE("Failed to set [mesh_hwmp_rootmode] : 4"); + + ret = mesh_netlink_set_mesh_parameter(mesh_interface, + "mesh_gate_announcements", 1); + if (MESHD_ERROR_NONE != ret) + MESH_LOGE("Failed to set [mesh_gate_announcements] : 1"); + return MESHD_ERROR_NONE; } diff --git a/src/mesh-service-interface.c b/src/mesh-service-interface.c index 7550e93..a37fca0 100644 --- a/src/mesh-service-interface.c +++ b/src/mesh-service-interface.c @@ -155,14 +155,14 @@ static gboolean _meshd_dbus_handle_enable(Manager *object, if (service->mesh_activated) { /* Already activated */ - manager_complete_enable(object, invocation, - MESHD_ERROR_OPERATION_FAILED); - } else { - /* Do API response first */ - manager_complete_enable(object, invocation, ret); - service->mesh_activated = TRUE; + manager_complete_enable(object, invocation, MESHD_ERROR_NONE); + goto FINISH; } + /* Do API response first */ + manager_complete_enable(object, invocation, ret); + service->mesh_activated = TRUE; + meshd_check_null_ret_error("info", info, FALSE); /* Register event handler first */ @@ -175,13 +175,7 @@ static gboolean _meshd_dbus_handle_enable(Manager *object, MESH_LOGE("Failed to mesh_interface_initialize [%d]", ret); goto FINISH; } -#if 0 - ret = mesh_request_load_saved_mesh_network(&service->saved_mesh_network); - if (MESHD_ERROR_NONE != ret) { - MESH_LOGE("Failed to mesh_request_load_saved_mesh_network [%d]", ret); - goto FINISH; - } -#endif + FINISH: net_mesh_emit_mesh_enabled(meshd_dbus_get_object(), ret);