Added Dbus method 'IsEapolEnabled'. 88/249788/2
authorNiraj Kumar Goit <niraj.g@samsung.com>
Wed, 16 Dec 2020 15:54:16 +0000 (21:24 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Mon, 25 Jan 2021 07:53:16 +0000 (13:23 +0530)
This patch fixes EAPoL enabled status on device reboot scenario.

Change-Id: Ib9fcbed659996eae42c6a30e7ee5f584aeaa19d2
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
packaging/connman.spec
src/service.c

index 6d17cd9..ccba7fb 100644 (file)
@@ -6,7 +6,7 @@
 
 Name:           connman
 Version:        1.38
-Release:        1
+Release:        2
 License:        GPL-2.0+
 Summary:        Connection Manager
 Url:            http://connman.net
index 5a73d09..c7088d2 100755 (executable)
@@ -7452,6 +7452,26 @@ static DBusMessage *reset_counters(DBusConnection *conn,
        return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 }
 
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+static DBusMessage *is_eapol_enabled(DBusConnection *conn,
+                                       DBusMessage *msg, void *user_data)
+{
+       struct connman_service *service = user_data;
+       DBG("service: %p path: %s UseEapol: %d", service, service->path, service->use_eapol);
+
+       dbus_bool_t eapol_status = service->use_eapol;
+
+       DBusMessage *reply = dbus_message_new_method_return(msg);
+       if (!reply) {
+               DBG("Failed to initialize reply");
+               return NULL;
+       }
+
+       dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &eapol_status, DBUS_TYPE_INVALID);
+       return reply;
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
+
 #if defined TIZEN_MAINTAIN_ONLINE
 static DBusMessage *downgrade_service(DBusConnection *conn,
                                        DBusMessage *msg, void *user_data)
@@ -7529,6 +7549,9 @@ static const GDBusMethodTable service_methods[] = {
                        GDBUS_ARGS({ "service", "o" }), NULL,
                        move_after) },
        { GDBUS_METHOD("ResetCounters", NULL, NULL, reset_counters) },
+#if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
+       { GDBUS_METHOD("IsEapolEnabled", NULL, GDBUS_ARGS({ "eapol", "b" }), is_eapol_enabled) },
+#endif
 #if defined TIZEN_MAINTAIN_ONLINE
        { GDBUS_METHOD("Downgrade", NULL, NULL, downgrade_service) },
 #endif