Disable rtnl and retry tx monitoring 88/324088/1
authorhyunsube-lee <hyunsube.lee@samsung.com>
Wed, 30 Apr 2025 07:39:06 +0000 (16:39 +0900)
committerHyunsub Lee <hyunsube.lee@samsung.com>
Tue, 13 May 2025 00:06:50 +0000 (00:06 +0000)
Change-Id: I1186340186ff11726bd5fa84f5b819a1e11917c2
(cherry picked from commit a3f9b668d1f8763fa1ea5859b9a35ace5e1afb88)

resources/var/lib/inm-manager/settings
src/inm-gdbus.c
src/inm-manager.c
src/inm-rtnl.c

index 7bc947ca111e01ab2d38bc9c514943959696a514..b3e372a4127f0ad0b0bb7654c0da4f89f9fe8d90 100644 (file)
@@ -11,6 +11,7 @@ SupportCommnanMonitoring=True
 SupportWpsMonitoring=True
 SupportDnsMonitoring=True
 SupportGatewayMonitoring=True
-SupportRtnlMonitoring=True
+SupportRtnlMonitoring=false
 SupportArpMonitoring=True
-SupportIfaceMonitoring=True
\ No newline at end of file
+SupportIfaceMonitoring=True
+SupportRetryTxRateMonitoring=false
\ No newline at end of file
index 9b001dce9307cd914905e729f9eb8d27276ff019..712246c3c94fcd77864d5cef1b05b21583d6bf9b 100644 (file)
@@ -44,6 +44,7 @@
 #define INM_ERR_STR_OUT_OF_MEMORY "net.inmmanager.Error.OutOfMemory"
 #define INM_ERR_STR_OP_FAILED "net.inmmanager.Error.OperationFailed"
 #define INM_ERR_STR_IN_PROGRESS "net.inmmanager.Error.InProgress"
+#define INM_ERR_STR_NOT_INITIALIZED "net.inmmanager.Error.NotInitialized"
 
 #define INM_WIFI_SERVICE INM_MANAGER_SERVICE ".wifi"
 #define INM_WIFI_IFACE INM_MANAGER_SERVICE ".wifi"
@@ -144,6 +145,13 @@ static void inm_error_in_progress(GError **error)
                        INM_ERR_STR_IN_PROGRESS);
 }
 
+static void inm_error_not_initialized(GError **error)
+{
+       *error = g_dbus_error_new_for_dbus_error(
+                       INM_ERR_STR_NOT_INITIALIZED,
+                       INM_ERR_STR_NOT_INITIALIZED);
+}
+
 void inm_error_set_gerror(inm_manager_error_e error_code, GError **error)
 {
        switch (error_code) {
@@ -162,6 +170,9 @@ void inm_error_set_gerror(inm_manager_error_e error_code, GError **error)
        case INM_MANAGER_ERROR_IN_PROGRESS:
                inm_error_in_progress(error);
                break;
+       case INM_MANAGER_ERROR_NOT_INITIALIZED:
+               inm_error_not_initialized(error);
+               break;
        default:
                INM_LOGI("Error Not handled [%d]", error_code);
                inm_error_operation_failed(error);
@@ -1144,7 +1155,14 @@ static inline void __handle_get_links(GVariant *parameters,
 
        __INM_FUNC_ENTER__;
        ret = inm_rtnl_get_links_variant(&arg);
-       if (ret != INM_MANAGER_ERROR_NONE) {
+
+       if (ret == INM_RTNL_ERROR_NOT_INITIALIZED) {
+               INM_LOGW("Not initialized");
+               __dbus_return_err(INM_MANAGER_ERROR_NOT_INITIALIZED, invocation);
+               __INM_FUNC_EXIT__;
+               return;
+       }
+       if (ret != INM_RTNL_ERROR_NONE) {
                INM_LOGW("Failed to get links");
                __dbus_return_err(INM_MANAGER_ERROR_OPERATION_FAILED, invocation);
                __INM_FUNC_EXIT__;
index 48195512eb8ecb1531a0aaea5f223d8d5b9518ea..f0cf6237ea323e501cded31027f04f755d94822d 100644 (file)
@@ -1070,9 +1070,13 @@ void __retry_tx_rate_cb(int retry_rate, gpointer user_data)
 
 static inline void __init_retry_tx_rate_monitor()
 {
-       int ret = 0;
-
        __INM_FUNC_ENTER__;
+       if (!check_monitoring_flag("SupportRetryTxRateMonitoring")) {
+               INM_LOGI("Retry monitoring not supported");
+               return;
+       }
+
+       int ret = 0;
        ret = inm_retry_tx_rate_monitor_start(__retry_tx_rate_cb, NULL);
        if (ret != INM_MANAGER_ERROR_NONE)
                INM_LOGW("inm_retry_tx_rate_monitor_start failed");
index 6d08f7881ed0e4ccd9f8464536847580b8d832b6..e3490ee88d6361fcc02b7544bc6ea125a6ae2ed3 100644 (file)
@@ -1470,6 +1470,10 @@ int inm_rtnl_get_links_variant(GVariant **gvar_links)
        int ret = INM_RTNL_ERROR_NONE;
 
        __INM_FUNC_ENTER__;
+       if (!is_initialized) {
+               INM_LOGI("rtnl monitoring is disabled.");
+               return INM_RTNL_ERROR_NOT_INITIALIZED;
+       }
 
        if (g_list_links == NULL || g_list_length(g_list_links) == 0) {
                INM_LOGW("No links");