Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."

Today's Topics:

   1. Borrow accounting assignment help if you face issues
      ([email protected])
   2. Office Help Setup ([email protected])
   3. [PATCH 0/1] ConnMan returns connect-failed when entering wrong password
      (Holesch, Simon (GED-SDD1))
   4. [PATCH 1/1] Detect invalid key with 4-way handshake offloading
      (Holesch, Simon (GED-SDD1))
   5. protect your crucial data from hackers and live without cyber concern
      ([email protected])
   6. [PATCH] Make DHCP client timeouts suspend aware
      (Holesch, Simon (GED-SDD1))


----------------------------------------------------------------------

Date: Tue, 01 Sep 2020 07:00:13 -0000
From: [email protected]
Subject: Borrow accounting assignment help if you face issues
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

If you can’t get enough time to write your accounting papers, you would never 
meet the deadlines. You have to keep some hours for paying attention to your 
studies, especially accounting papers. Accounting is all about numerical 
questions and calculations. You have to keep some time for composing your 
papers and solve all questions related to your accounting. In this situation, 
you can use an accounting assignment help. When you have less knowledge of 
accounting concepts such as auditing, financial accounting, fund accounting, 
tax accounting, business valuation, and many more, you find it tough to compose 
your papers. In this situation, you must buy online assignment help services 
and get expert’s assistance at any time. The online services of assignment 
writing allow you to connect with professionals and share your concerns with 
them. You don’t have to take tension in anything when you transfer your papers 
to experts. Thus, if you find it hard to compose your accounting papers, you 
must think about the assistance of online tutors. 
https://www.greatassignmenthelp.com/accounting-assignment-help/

------------------------------

Date: Tue, 01 Sep 2020 10:08:31 -0000
From: [email protected]
Subject: Office Help Setup
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

If you want to protect your crucial data from hackers and live without cyber 
concern, go to these websites - 

http://go-officecom.com/
https://justnorton.com/
http://prooffice-comsetup.com/

------------------------------

Date: Tue, 1 Sep 2020 10:13:33 +0000
From: "Holesch, Simon (GED-SDD1)" <[email protected]>
Subject: [PATCH 0/1] ConnMan returns connect-failed when entering
        wrong password
To: "[email protected]" <[email protected]>
Cc: "Holesch, Simon (GED-SDD1)" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

I updated the wifi plugin to work with our setup, but I'm not sure if
the assoc_code is driver / firmware specific.

Holesch, Simon (BSH) (1):
  Detect invalid key with 4-way handshake offloading

 plugins/wifi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.17.1

------------------------------

Date: Tue, 1 Sep 2020 10:13:36 +0000
From: "Holesch, Simon (GED-SDD1)" <[email protected]>
Subject: [PATCH 1/1] Detect invalid key with 4-way handshake
        offloading
To: "[email protected]" <[email protected]>
Cc: "Holesch, Simon (GED-SDD1)" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

wpa_supplicant is able to offload the 4-way handshake into the driver.
In this case the 4wAY_HANDSHAKE state is skipped and therefore the
current mechanism to detect a wrong password doesn't work any more. This
patch extends the detection mechanism to also work with the offloading
feature. The status code 16 is relatively generic, so this can lead to
false positives.
---
 plugins/wifi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index fc304e3b..74b773bc 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -74,6 +74,7 @@
 #define P2P_LISTEN_PERIOD 500
 #define P2P_LISTEN_INTERVAL 2000
 
+#define ASSOC_STATUS_AUTH_TIMEOUT 16
 #define ASSOC_STATUS_NO_CLIENT 17
 #define LOAD_SHAPING_MAX_RETRIES 3
 
@@ -2422,7 +2423,9 @@ static bool 
handle_4way_handshake_failure(GSupplicantInterface *interface,
 {
        struct connman_service *service;
 
-       if (wifi->state != G_SUPPLICANT_STATE_4WAY_HANDSHAKE)
+       if ((wifi->state != G_SUPPLICANT_STATE_4WAY_HANDSHAKE) &&
+                       !((wifi->state == G_SUPPLICANT_STATE_ASSOCIATING) &&
+                               (wifi->assoc_code == 
ASSOC_STATUS_AUTH_TIMEOUT)))
                return false;
 
        if (wifi->connected)
-- 
2.17.1

------------------------------

Date: Tue, 01 Sep 2020 10:26:32 -0000
From: [email protected]
Subject: protect your crucial data from hackers and live without cyber
        concern
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

http://sitemcafee.com  - McAfee antivirus offers complete protection to their 
users for securing their data against malware. 

https://smnorton.com - The digital world is communicated through the internet, 
and it’s the major source of various information circulated on the web. 

http://start-mcafee.com -  McAfee Antivirus is the world’s highly used 
Antivirus programs that remove the malware and infection and avoids the chances 
of security threats.

------------------------------

Date: Tue, 1 Sep 2020 11:58:13 +0000
From: "Holesch, Simon (GED-SDD1)" <[email protected]>
Subject: [PATCH] Make DHCP client timeouts suspend aware
To: "[email protected]" <[email protected]>
Cc: "Holesch, Simon (GED-SDD1)" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

The glib timeout uses CLOCK_MONOTONIC, which is paused during suspend on
Linux and is therefore unfit for network timeouts. This patch introduces
timeouts based on CLOCK_BOOTTIME_ALARM, which wakes the system on
timeout.
---
 gdhcp/client.c         | 184 +++++++++++++++++++++++++++++++----------
 src/connman.service.in |   2 +-
 2 files changed, 143 insertions(+), 43 deletions(-)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index 09dfe5ec..286aa68a 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -32,6 +32,7 @@
 #include <arpa/inet.h>
 #include <sys/time.h>
 #include <resolv.h>
+#include <sys/timerfd.h>
 
 #include <netpacket/packet.h>
 #include <netinet/if_ether.h>
@@ -41,6 +42,7 @@
 #include <linux/filter.h>
 
 #include <glib.h>
+#include <glib-unix.h>
 
 #include "../src/connman.h"
 #include "../src/shared/arp.h"
@@ -160,6 +162,12 @@ struct _GDHCPClient {
        bool request_bcast;
 };
 
+typedef struct {
+       int fd;
+       GSourceFunc callback;
+       gpointer data;
+} TimeoutUserData;
+
 static inline void debug(GDHCPClient *client, const char *format, ...)
 {
        char str[256];
@@ -176,6 +184,100 @@ static inline void debug(GDHCPClient *client, const char 
*format, ...)
        va_end(ap);
 }
 
+static gboolean on_timerfd_timeout(gint fd,
+                                       GIOCondition condition,
+                                       gpointer data)
+{
+       (void)fd;
+       (void)condition;
+       TimeoutUserData *user_data = (TimeoutUserData *)data;
+       return user_data->callback(user_data->data);
+}
+
+static void on_timerfd_destroy(gpointer data)
+{
+       TimeoutUserData *user_data = (TimeoutUserData *)data;
+       close(user_data->fd);
+       free(user_data);
+}
+
+static guint timeout_start_timespec(GDHCPClient *dhcp_client,
+                                       gint priority,
+                                       struct timespec *interval,
+                                       GSourceFunc function,
+                                       gpointer data)
+{
+       TimeoutUserData *user_data = g_try_malloc(sizeof(TimeoutUserData));
+       if (user_data == NULL) {
+               return 0;
+       }
+       user_data->callback = function;
+       user_data->data = data;
+
+       /* CLOCK_BOOTTIME_ALARM continues to run while the system is suspended 
and
+        * wakes it up on timeout. The glib timeout uses CLOCK_MONOTONIC, which 
is
+        * paused during suspend on Linux and is therefore unfit for network
+        * timeouts. */
+       user_data->fd = timerfd_create(CLOCK_BOOTTIME_ALARM,
+                                               TFD_NONBLOCK | TFD_CLOEXEC);
+       if (user_data->fd == -1) {
+               debug(dhcp_client, "Error creating timerfd: %s", 
strerror(errno));
+               free(user_data);
+               return 0;
+       }
+
+       struct itimerspec timeout = {
+               .it_value = *interval,
+               .it_interval = *interval,
+       };
+       int flags = 0;
+       struct itimerspec *old_value = NULL;
+       int err = timerfd_settime(user_data->fd, flags, &timeout, old_value);
+       if (err) {
+               debug(dhcp_client, "Error setting timerfd timeout: %s",
+                               strerror(errno));
+               close(user_data->fd);
+               free(user_data);
+               return 0;
+       }
+
+       /* The file descriptor returned by timerfd_create can be polled and 
becomes
+        * readable on timeout. Add the fd to the glib event loop. */
+       guint id = g_unix_fd_add_full(priority, user_data->fd, G_IO_IN,
+                               on_timerfd_timeout, user_data, 
on_timerfd_destroy);
+       if (id == 0) {
+               debug(dhcp_client, "Error adding timerfd to event loop");
+               close(user_data->fd);
+               free(user_data);
+       }
+       return id;
+}
+
+static guint timeout_start_seconds(GDHCPClient *dhcp_client,
+                                               gint priority,
+                                               guint32 interval,
+                                               GSourceFunc function,
+                                               gpointer data)
+{
+       struct timespec timeout = { .tv_sec = interval };
+       return timeout_start_timespec(dhcp_client, priority, &timeout,
+                       function, data);
+}
+
+static guint timeout_start_ms(GDHCPClient *dhcp_client,
+                                               gint priority,
+                                               guint32 interval,
+                                               GSourceFunc function,
+                                               gpointer data)
+{
+       struct timespec timeout = {
+               .tv_sec = interval / 1000,
+               .tv_nsec = (long)(interval % 1000) * 1000000,
+       };
+       return timeout_start_timespec(dhcp_client, priority, &timeout,
+                       function, data);
+}
+
 /* Initialize the packet with the proper defaults */
 static void init_packet(GDHCPClient *dhcp_client, gpointer pkt, char type)
 {
@@ -595,11 +697,11 @@ static gboolean send_probe_packet(gpointer dhcp_data)
        } else
                timeout = (ANNOUNCE_WAIT * 1000);
 
-       dhcp_client->timeout = g_timeout_add_full(G_PRIORITY_HIGH,
+       dhcp_client->timeout = timeout_start_ms(dhcp_client,
+                                                G_PRIORITY_HIGH,
                                                 timeout,
                                                 ipv4ll_probe_timeout,
-                                                dhcp_client,
-                                                NULL);
+                                                dhcp_client);
        return FALSE;
 }
 
@@ -623,19 +725,19 @@ static gboolean send_announce_packet(gpointer dhcp_data)
 
        if (dhcp_client->state == IPV4LL_DEFEND) {
                dhcp_client->timeout =
-                       g_timeout_add_seconds_full(G_PRIORITY_HIGH,
+                       timeout_start_seconds(dhcp_client,
+                                               G_PRIORITY_HIGH,
                                                DEFEND_INTERVAL,
                                                ipv4ll_defend_timeout,
-                                               dhcp_client,
-                                               NULL);
+                                               dhcp_client);
                return TRUE;
        } else
                dhcp_client->timeout =
-                       g_timeout_add_seconds_full(G_PRIORITY_HIGH,
+                       timeout_start_seconds(dhcp_client,
+                                               G_PRIORITY_HIGH,
                                                ANNOUNCE_INTERVAL,
                                                ipv4ll_announce_timeout,
-                                               dhcp_client,
-                                               NULL);
+                                               dhcp_client);
        return TRUE;
 }
 
@@ -1383,11 +1485,11 @@ static void ipv4ll_start(GDHCPClient *dhcp_client)
        timeout = __connman_util_random_delay_ms(PROBE_WAIT);
 
        dhcp_client->retry_times++;
-       dhcp_client->timeout = g_timeout_add_full(G_PRIORITY_HIGH,
+       dhcp_client->timeout = timeout_start_ms(dhcp_client,
+                                               G_PRIORITY_HIGH,
                                                timeout,
                                                send_probe_packet,
-                                               dhcp_client,
-                                               NULL);
+                                               dhcp_client);
 }
 
 static void ipv4ll_stop(GDHCPClient *dhcp_client)
@@ -1475,11 +1577,11 @@ static int ipv4ll_recv_arp_packet(GDHCPClient 
*dhcp_client)
                timeout_ms = RATE_LIMIT_INTERVAL * 1000;
        dhcp_client->retry_times++;
        dhcp_client->timeout =
-               g_timeout_add_full(G_PRIORITY_HIGH,
+               timeout_start_ms(dhcp_client,
+                               G_PRIORITY_HIGH,
                                timeout_ms,
                                send_probe_packet,
-                               dhcp_client,
-                               NULL);
+                               dhcp_client);
 
        return 0;
 }
@@ -1622,11 +1724,11 @@ static void start_request(GDHCPClient *dhcp_client)
 
        send_request(dhcp_client);
 
-       dhcp_client->timeout = g_timeout_add_seconds_full(G_PRIORITY_HIGH,
+       dhcp_client->timeout = timeout_start_seconds(dhcp_client,
+                                                       G_PRIORITY_HIGH,
                                                        REQUEST_TIMEOUT,
                                                        request_timeout,
-                                                       dhcp_client,
-                                                       NULL);
+                                                       dhcp_client);
 }
 
 static uint32_t get_lease(struct dhcp_packet *packet)
@@ -1697,11 +1799,11 @@ static gboolean continue_rebound(gpointer user_data)
        if (dhcp_client->T2 > 60) {
                __connman_util_get_random(&rand);
                dhcp_client->t2_timeout =
-                       g_timeout_add_full(G_PRIORITY_HIGH,
+                       timeout_start_ms(dhcp_client,
+                                       G_PRIORITY_HIGH,
                                        dhcp_client->T2 * 1000 + (rand % 2000) 
- 1000,
                                        continue_rebound,
-                                       dhcp_client,
-                                       NULL);
+                                       dhcp_client);
        }
 
        return FALSE;
@@ -1744,11 +1846,11 @@ static gboolean continue_renew (gpointer user_data)
 
        if (dhcp_client->T1 > 60) {
                __connman_util_get_random(&rand);
-               dhcp_client->t1_timeout = g_timeout_add_full(G_PRIORITY_HIGH,
+               dhcp_client->t1_timeout = timeout_start_ms(dhcp_client,
+                               G_PRIORITY_HIGH,
                                dhcp_client->T1 * 1000 + (rand % 2000) - 1000,
                                continue_renew,
-                               dhcp_client,
-                               NULL);
+                               dhcp_client);
        }
 
        return FALSE;
@@ -1786,20 +1888,20 @@ static void start_bound(GDHCPClient *dhcp_client)
        dhcp_client->T2 = dhcp_client->lease_seconds * 0.875;
        dhcp_client->expire = dhcp_client->lease_seconds;
 
-       dhcp_client->t1_timeout = g_timeout_add_seconds_full(G_PRIORITY_HIGH,
+       dhcp_client->t1_timeout = timeout_start_seconds(dhcp_client,
+                                       G_PRIORITY_HIGH,
                                        dhcp_client->T1,
-                                       start_renew, dhcp_client,
-                                                       NULL);
+                                       start_renew, dhcp_client);
 
-       dhcp_client->t2_timeout = g_timeout_add_seconds_full(G_PRIORITY_HIGH,
+       dhcp_client->t2_timeout = timeout_start_seconds(dhcp_client,
+                                       G_PRIORITY_HIGH,
                                        dhcp_client->T2,
-                                       start_rebound, dhcp_client,
-                                                       NULL);
+                                       start_rebound, dhcp_client);
 
-       dhcp_client->lease_timeout= g_timeout_add_seconds_full(G_PRIORITY_HIGH,
+       dhcp_client->lease_timeout= timeout_start_seconds(dhcp_client,
+                                       G_PRIORITY_HIGH,
                                        dhcp_client->expire,
-                                       start_expire, dhcp_client,
-                                                       NULL);
+                                       start_expire, dhcp_client);
 }
 
 static gboolean restart_dhcp_timeout(gpointer user_data)
@@ -2454,11 +2556,10 @@ static gboolean listener_event(GIOChannel *channel, 
GIOCondition condition,
 
                        remove_timeouts(dhcp_client);
 
-                       dhcp_client->timeout = g_timeout_add_seconds_full(
+                       dhcp_client->timeout = 
timeout_start_seconds(dhcp_client,
                                                        G_PRIORITY_HIGH, 3,
                                                        restart_dhcp_timeout,
-                                                       dhcp_client,
-                                                       NULL);
+                                                       dhcp_client);
                }
 
                break;
@@ -2877,21 +2978,20 @@ int g_dhcp_client_start(GDHCPClient *dhcp_client, const 
char *last_address)
                dhcp_client->state = REBOOTING;
                send_request(dhcp_client);
 
-               dhcp_client->timeout = g_timeout_add_seconds_full(
+               dhcp_client->timeout = timeout_start_seconds(dhcp_client,
                                                                G_PRIORITY_HIGH,
                                                                REQUEST_TIMEOUT,
                                                                reboot_timeout,
-                                                               dhcp_client,
-                                                               NULL);
+                                                               dhcp_client);
                return 0;
        }
        send_discover(dhcp_client, addr);
 
-       dhcp_client->timeout = g_timeout_add_seconds_full(G_PRIORITY_HIGH,
+       dhcp_client->timeout = timeout_start_seconds(dhcp_client,
+                                                       G_PRIORITY_HIGH,
                                                        DISCOVER_TIMEOUT,
                                                        discover_timeout,
-                                                       dhcp_client,
-                                                       NULL);
+                                                       dhcp_client);
        return 0;
 }
 
diff --git a/src/connman.service.in b/src/connman.service.in
index 7376346e..43b067df 100644
--- a/src/connman.service.in
+++ b/src/connman.service.in
@@ -13,7 +13,7 @@ BusName=net.connman
 Restart=on-failure
 ExecStart=@sbindir@/connmand -n
 StandardOutput=null
-CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW 
CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_ADMIN
+CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW 
CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_ADMIN CAP_WAKE_ALARM
 ProtectHome=true
 ProtectSystem=full
 
-- 
2.17.1

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]


------------------------------

End of connman Digest, Vol 59, Issue 1
**************************************

Reply via email to