From f9e4ceaced5d19dc963b15dc8c664375d45e16a8 Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Wed, 16 Dec 2020 20:58:38 +0530 Subject: [PATCH] Fixed IsEapolEnabled status check on device reboot. Dbus method 'IsEapolEnabled' call moved to connman to fix EAPoL enabled status check in case of device reboot. Change-Id: If4f2b26c93f0dc2da731cde4539fece54c97cca5 Signed-off-by: Niraj Kumar Goit --- include/common/network-cm-intf.h | 5 +++-- include/internal/network-dbus-request.h | 2 +- packaging/libnet-client.spec | 2 +- src/network-cm-intf.c | 4 ++-- src/network-dbus-request.c | 8 ++++---- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/common/network-cm-intf.h b/include/common/network-cm-intf.h index 762856a..5655fab 100755 --- a/include/common/network-cm-intf.h +++ b/include/common/network-cm-intf.h @@ -838,10 +838,11 @@ int net_ethernet_eap_enable(gboolean enable, const char *profilename); /** * \brief This API is only for Connection CAPI. Don't use this. * - * \param[out] supported Indicating whether the EAP over Ethernet is supported. + * \param[in] pofilename Profile name of ethernet. + * \param[out] enabled Indicating whether the EAP over Ethernet is enabled. * ******************************************************************************************/ -int net_ethernet_eap_supported(gboolean *supported); +int net_ethernet_eap_enabled(const char *profilename, gboolean *enabled); /** * \brief This API is only for Connection CAPI. Don't use this. diff --git a/include/internal/network-dbus-request.h b/include/internal/network-dbus-request.h index c2be954..79cae0d 100755 --- a/include/internal/network-dbus-request.h +++ b/include/internal/network-dbus-request.h @@ -149,7 +149,7 @@ int _net_dbus_mptcp_set_scheduler(network_info_t *network_info, const char *sche int _net_dbus_mptcp_get_scheduler(network_info_t *network_info, char **scheduler); int _net_dbus_ethernet_eap_enable(gboolean enable, const char *profilename); -int _net_dbus_ethernet_eap_supported(gboolean *supported); +int _net_dbus_ethernet_eap_enabled(const char *profilename, gboolean *enabled); int _net_dbus_save_ethernet_eap_connection(network_info_t *network_info, net_dev_info_t *net_info); #ifdef __cplusplus diff --git a/packaging/libnet-client.spec b/packaging/libnet-client.spec index 81c2fb9..ddfc689 100755 --- a/packaging/libnet-client.spec +++ b/packaging/libnet-client.spec @@ -1,7 +1,7 @@ Name: libnet-client Summary: Network Client library (Shared library) Version: 1.2.6 -Release: 1 +Release: 2 Group: System/Network License: Flora-1.1 Source0: %{name}-%{version}.tar.gz diff --git a/src/network-cm-intf.c b/src/network-cm-intf.c index 1125062..cbe6c22 100755 --- a/src/network-cm-intf.c +++ b/src/network-cm-intf.c @@ -826,12 +826,12 @@ EXPORT_API int net_ethernet_eap_enable(gboolean enable, const char *profilename) return Error; } -EXPORT_API int net_ethernet_eap_supported(gboolean *supported) +EXPORT_API int net_ethernet_eap_enabled(const char *profilename, gboolean *enabled) { __NETWORK_FUNC_ENTER__; net_err_t Error = NET_ERR_NONE; - Error = _net_dbus_ethernet_eap_supported(supported); + Error = _net_dbus_ethernet_eap_enabled(profilename, enabled); if (Error != NET_ERR_NONE) NETWORK_LOG(NETWORK_ERROR, "_net_dbus_ethernet_eap_supported failed"); diff --git a/src/network-dbus-request.c b/src/network-dbus-request.c index a6726b6..061e02c 100755 --- a/src/network-dbus-request.c +++ b/src/network-dbus-request.c @@ -2253,14 +2253,14 @@ int _net_dbus_ethernet_eap_enable(gboolean enable, const char *profilename) return Error; } -int _net_dbus_ethernet_eap_supported(gboolean *supported) +int _net_dbus_ethernet_eap_enabled(const char* profilename, gboolean *enabled) { __NETWORK_FUNC_ENTER__; net_err_t Error = NET_ERR_NONE; GVariant *message = NULL; - message = _net_invoke_dbus_method(NULL, NETCONFIG_SERVICE, NETCONFIG_ETHERNET_PATH, - NETCONFIG_ETHERNET_INTERFACE, "IsEapSupported", NULL, &Error); + message = _net_invoke_dbus_method(NULL, CONNMAN_SERVICE, profilename, + CONNMAN_SERVICE_INTERFACE, "IsEapolEnabled", NULL, &Error); if (message == NULL) { NETWORK_LOG(NETWORK_ERROR, "Failed to get EAP over Ethernet status"); @@ -2268,7 +2268,7 @@ int _net_dbus_ethernet_eap_supported(gboolean *supported) return Error; } - g_variant_get(message, "(b)", supported); + g_variant_get(message, "(b)", enabled); g_variant_unref(message); __NETWORK_FUNC_EXIT__; -- 2.7.4