Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ell for openSUSE:Factory checked in 
at 2021-06-25 15:00:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ell (Old)
 and      /work/SRC/openSUSE:Factory/.ell.new.2625 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ell"

Fri Jun 25 15:00:31 2021 rev:20 rq:901223 version:0.41

Changes:
--------
--- /work/SRC/openSUSE:Factory/ell/ell.changes  2021-05-15 23:16:31.356657574 
+0200
+++ /work/SRC/openSUSE:Factory/.ell.new.2625/ell.changes        2021-06-25 
15:00:34.484095718 +0200
@@ -1,0 +2,7 @@
+Mon Jun 21 19:52:55 UTC 2021 - Jan Engelhardt <jeng...@inai.de>
+
+- Update to release 0.41
+  * Fix issue with endianness of DHCP packets.
+  * Fix issue with lease handling of the DHCP server.
+
+-------------------------------------------------------------------

Old:
----
  ell-0.40.tar.sign
  ell-0.40.tar.xz

New:
----
  ell-0.41.tar.sign
  ell-0.41.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ell.spec ++++++
--- /var/tmp/diff_new_pack.O0eBCf/_old  2021-06-25 15:00:35.028096382 +0200
+++ /var/tmp/diff_new_pack.O0eBCf/_new  2021-06-25 15:00:35.028096382 +0200
@@ -18,12 +18,13 @@
 
 %define lname   libell0
 Name:           ell
-Version:        0.40
+Version:        0.41
 Release:        0
 Summary:        Wireless setup and cryptography library
 License:        LGPL-2.1-or-later
 Group:          Development/Libraries/C and C++
 URL:            https://01.org/ell
+#Git-Clone:     https://git.kernel.org/pub/scm/libs/ell/ell.git
 Source:         
https://mirrors.kernel.org/pub/linux/libs/ell/%name-%version.tar.xz
 Source2:        
https://mirrors.kernel.org/pub/linux/libs/ell/%name-%version.tar.sign
 Source3:        %name.keyring

++++++ ell-0.40.tar.xz -> ell-0.41.tar.xz ++++++
++++ 1638 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/AUTHORS new/ell-0.41/AUTHORS
--- old/ell-0.40/AUTHORS        2021-02-04 17:11:59.000000000 +0100
+++ new/ell-0.41/AUTHORS        2021-06-11 20:09:50.000000000 +0200
@@ -30,3 +30,4 @@
 Jonathan Liu <net...@gmail.com>
 ??rico Nogueira <eric...@disroot.org>
 Mauro Condarelli <mc5...@mclink.it>
+Davide Caratti <davide.cara...@gmail.com>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ChangeLog new/ell-0.41/ChangeLog
--- old/ell-0.40/ChangeLog      2021-05-02 13:06:43.000000000 +0200
+++ new/ell-0.41/ChangeLog      2021-06-11 20:09:50.000000000 +0200
@@ -1,3 +1,7 @@
+ver 0.41:
+       Fix issue with endianness of DHCP packets.
+       Fix issue with lease handling of the DHCP server.
+
 ver 0.40:
        Fix issue with handling failure from missing CA certificates.
        Fix issue with handling DBus.Introspectable queries.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/README new/ell-0.41/README
--- old/ell-0.40/README 2017-10-05 15:53:32.000000000 +0200
+++ new/ell-0.41/README 2021-06-11 20:09:50.000000000 +0200
@@ -52,7 +52,7 @@
        e...@lists.01.org
 
 IRC:
-       irc://irc.freenode.net/#ell
+       irc://irc.oftc.net/#ell
 
 For additional information about the project visit the ELL web site:
        https://01.org/ell
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/build-aux/compile new/ell-0.41/build-aux/compile
--- old/ell-0.40/build-aux/compile      2018-11-05 05:03:34.000000000 +0100
+++ new/ell-0.41/build-aux/compile      2021-01-04 06:32:20.000000000 +0100
@@ -3,7 +3,7 @@
 
 scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 # Written by Tom Tromey <tro...@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -53,7 +53,7 @@
          MINGW*)
            file_conv=mingw
            ;;
-         CYGWIN*)
+         CYGWIN* | MSYS*)
            file_conv=cygwin
            ;;
          *)
@@ -67,7 +67,7 @@
        mingw/*)
          file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
          ;;
-       cygwin/*)
+       cygwin/* | msys/*)
          file=`cygpath -m "$file" || echo "$file"`
          ;;
        wine/*)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/build-aux/libtool.m4 new/ell-0.41/build-aux/libtool.m4
--- old/ell-0.40/build-aux/libtool.m4   2020-02-07 17:15:16.000000000 +0100
+++ new/ell-0.41/build-aux/libtool.m4   2021-01-09 21:49:30.000000000 +0100
@@ -1071,11 +1071,11 @@
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+       10.0,*86*-darwin8*|10.0,*-darwin[[912]]*)
          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
        10.[[012]][[,.]]*)
          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined 
${wl}suppress' ;;
-       10.*)
+       10.*|11.*)
          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/build-aux/missing new/ell-0.41/build-aux/missing
--- old/ell-0.40/build-aux/missing      2018-11-05 05:03:34.000000000 +0100
+++ new/ell-0.41/build-aux/missing      2021-01-04 06:32:20.000000000 +0100
@@ -3,7 +3,7 @@
 
 scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pin...@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/build-aux/test-driver new/ell-0.41/build-aux/test-driver
--- old/ell-0.40/build-aux/test-driver  2018-11-05 05:03:34.000000000 +0100
+++ new/ell-0.41/build-aux/test-driver  2021-01-04 06:32:20.000000000 +0100
@@ -3,7 +3,7 @@
 
 scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2011-2018 Free Software Foundation, Inc.
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -42,11 +42,13 @@
 {
   cat <<END
 Usage:
-  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
-              [--expect-failure={yes|no}] [--color-tests={yes|no}]
-              [--enable-hard-errors={yes|no}] [--]
+  test-driver --test-name NAME --log-file PATH --trs-file PATH
+              [--expect-failure {yes|no}] [--color-tests {yes|no}]
+              [--enable-hard-errors {yes|no}] [--]
               TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+
 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+See the GNU Automake documentation for information.
 END
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/configure.ac new/ell-0.41/configure.ac
--- old/ell-0.40/configure.ac   2021-05-02 13:06:43.000000000 +0200
+++ new/ell-0.41/configure.ac   2021-06-11 20:09:50.000000000 +0200
@@ -1,5 +1,5 @@
 AC_PREREQ(2.60)
-AC_INIT(ell, 0.40)
+AC_INIT(ell, 0.41)
 
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_AUX_DIR(build-aux)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/dbus-filter.c new/ell-0.41/ell/dbus-filter.c
--- old/ell-0.40/ell/dbus-filter.c      2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/dbus-filter.c      2021-06-11 20:09:50.000000000 +0200
@@ -309,6 +309,8 @@
 
                }
 
+_Pragma("GCC diagnostic push")
+_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
                /*
                 * Mark the condition used.  We do this by setting
                 * condition->type to an invalid value unless it is the
@@ -330,6 +332,7 @@
                 * have yet created an AddMatch rule on the server.
                 */
                remote_rule |= node->match.remote_rule;
+_Pragma("GCC diagnostic pop")
        }
 
        node = l_new(struct filter_node, 1);
@@ -346,8 +349,11 @@
                                                rule, rule_len))
                        goto err;
 
+_Pragma("GCC diagnostic push")
+_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
                parent->id = node->id;
                parent->match.remote_rule = true;
+_Pragma("GCC diagnostic pop")
        }
 
        return node->id;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/dhcp-private.h new/ell-0.41/ell/dhcp-private.h
--- old/ell-0.40/ell/dhcp-private.h     2020-11-29 22:35:22.000000000 +0100
+++ new/ell-0.41/ell/dhcp-private.h     2021-06-11 20:09:50.000000000 +0200
@@ -158,6 +158,7 @@
        uint32_t lifetime;
        uint32_t t1;
        uint32_t t2;
+       uint64_t bound_time;
        uint32_t router;
        uint32_t *dns;
        char *domain_name;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/dhcp-server.c new/ell-0.41/ell/dhcp-server.c
--- old/ell-0.40/ell/dhcp-server.c      2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/dhcp-server.c      2021-06-11 20:09:50.000000000 +0200
@@ -30,6 +30,7 @@
 #include <arpa/inet.h>
 #include <time.h>
 #include <errno.h>
+#include <limits.h>
 
 #include "private.h"
 #include "time.h"
@@ -41,6 +42,8 @@
 #include "strv.h"
 #include "timeout.h"
 #include "acd.h"
+#include "log.h"
+#include "util.h"
 
 /* 8 hours */
 #define DEFAULT_DHCP_LEASE_SEC (8*60*60)
@@ -102,12 +105,14 @@
        l_util_debug(server->debug_handler, server->debug_data,         \
                        "%s:%i " fmt, __func__, __LINE__, ## args)
 
-static bool is_expired_lease(struct l_dhcp_lease *lease)
+static uint64_t get_lease_expiry_time(const struct l_dhcp_lease *lease)
 {
-       if (lease->lifetime < l_time_to_secs(l_time_now()))
-               return true;
+       return lease->bound_time + lease->lifetime * L_USEC_PER_SEC;
+}
 
-       return false;
+static bool is_expired_lease(const struct l_dhcp_lease *lease)
+{
+       return !l_time_after(get_lease_expiry_time(lease), l_time_now());
 }
 
 static bool match_lease_mac(const void *data, const void *user_data)
@@ -169,11 +174,12 @@
        return 0;
 }
 
-static int compare_lifetime_or_offering(const void *a, const void *b,
+static int compare_expiry_or_offering(const void *a, const void *b,
                                        void *user_data)
 {
        const struct l_dhcp_lease *lease1 = a;
        const struct l_dhcp_lease *lease2 = b;
+       int64_t diff;
 
        /*
         * Ensures offered but not active leases stay at the head of the queue.
@@ -182,7 +188,9 @@
        if (lease1->offering)
                return 1;
 
-       return lease2->lifetime - lease1->lifetime;
+       diff = (int64_t) lease2->bound_time - lease1->bound_time +
+               ((int64_t) lease2->lifetime - lease1->lifetime) * 
L_USEC_PER_SEC;
+       return diff >= 0 ? diff > 0 ? 1 : 0 : -1;
 }
 
 static void lease_expired_cb(struct l_timeout *timeout, void *user_data);
@@ -191,7 +199,6 @@
                                        struct l_dhcp_lease *expired)
 {
        struct l_dhcp_lease *next;
-       unsigned int next_timeout;
 
        /*
         * If this is an expiring lease put it into the expired queue, removing
@@ -209,25 +216,29 @@
 
        next = l_queue_peek_tail(server->lease_list);
        if (!next || next->offering) {
+               l_timeout_remove(server->next_expire);
                server->next_expire = NULL;
                return;
        }
 
-       next_timeout = l_time_to_secs(l_time_diff(l_time_now(),
-                                                       next->lifetime));
-
-       if (server->next_expire)
-               l_timeout_modify(server->next_expire, next_timeout);
-       else
-               server->next_expire = l_timeout_create(server->lease_seconds,
-                                                       lease_expired_cb,
-                                                       server, NULL);
+       if (server->next_expire) {
+               uint64_t expiry = get_lease_expiry_time(next);
+               uint64_t now = l_time_now();
+               uint64_t next_timeout = l_time_after(expiry, now) ?
+                       l_time_to_msecs(expiry - now) : 0;
+
+               l_timeout_modify_ms(server->next_expire, next_timeout ?: 1);
+       } else
+               server->next_expire = l_timeout_create(
+                                               server->lease_seconds,
+                                               lease_expired_cb,
+                                               server, NULL);
 }
 
 static void lease_expired_cb(struct l_timeout *timeout, void *user_data)
 {
        struct l_dhcp_server *server = user_data;
-       struct l_dhcp_lease *lease = l_queue_peek_tail(server->expired_list);
+       struct l_dhcp_lease *lease = l_queue_peek_tail(server->lease_list);
 
        if (server->event_handler)
                server->event_handler(server, L_DHCP_SERVER_EVENT_LEASE_EXPIRED,
@@ -253,24 +264,24 @@
        lease->address = yiaddr;
 
        lease->offering = offering;
-       lease->lifetime = l_time_to_secs(l_time_now());
+       lease->bound_time = l_time_now();
 
        if (!offering) {
-               lease->lifetime += server->lease_seconds;
+               lease->lifetime = server->lease_seconds;
 
                /*
                 * Insert into queue by lifetime (skipping any offered leases
                 * at the head)
                 */
                l_queue_insert(server->lease_list, lease,
-                                       compare_lifetime_or_offering, NULL);
+                                       compare_expiry_or_offering, NULL);
                /*
                 * This is a new (or renewed lease) so pass NULL for expired so
                 * the queue's are not modified, only the next_expired timer
                 */
                set_next_expire_timer(server, NULL);
        } else {
-               lease->lifetime += OFFER_TIME;
+               lease->lifetime = OFFER_TIME;
                /* Push offered leases to head, active leases after those */
                l_queue_push_head(server->lease_list, lease);
        }
@@ -285,14 +296,6 @@
 static void lease_release(struct l_dhcp_server *server,
                        struct l_dhcp_lease *lease)
 {
-       /*
-        * If the client released the lease after the server timeout expired
-        * there is nothing to do. Otherwise the client is releasing the
-        * lease early which may require re-setting the lease expire timer
-        */
-       if (is_expired_lease(lease))
-               return;
-
        if (server->event_handler)
                server->event_handler(server, L_DHCP_SERVER_EVENT_LEASE_EXPIRED,
                                        server->user_data, lease);
@@ -390,7 +393,9 @@
        if (!lease)
                return 0;
 
-       return lease->address;
+       ip_addr = lease->address;
+       _dhcp_lease_free(lease);
+       return ip_addr;
 }
 
 static void server_message_init(struct l_dhcp_server *server,
@@ -652,7 +657,8 @@
        case DHCP_MESSAGE_TYPE_DECLINE:
                SERVER_DEBUG("Received DECLINE");
 
-               if (!server_id_opt || !requested_ip_opt || !lease)
+               if (!server_id_opt || !requested_ip_opt || !lease ||
+                               !lease->offering)
                        break;
 
                if (requested_ip_opt == lease->address)
@@ -662,7 +668,7 @@
        case DHCP_MESSAGE_TYPE_RELEASE:
                SERVER_DEBUG("Received RELEASE");
 
-               if (!server_id_opt || !lease)
+               if (!server_id_opt || !lease || lease->offering)
                        break;
 
                if (message->ciaddr == lease->address)
@@ -775,7 +781,7 @@
 
        /* Assign a default netmask if not already */
        if (!server->netmask) {
-               if (inet_aton("255.255.255.0", &ia) < 0)
+               if (inet_pton(AF_INET,"255.255.255.0", &ia) != 1)
                        return false;
 
                server->netmask = ia.s_addr;
@@ -891,12 +897,12 @@
        if (unlikely(!server || !start_ip || !end_ip))
                return false;
 
-       if (inet_aton(start_ip, &_host_addr) == 0)
+       if (inet_pton(AF_INET, start_ip, &_host_addr) != 1)
                return false;
 
        start = ntohl(_host_addr.s_addr);
 
-       if (inet_aton((const char *) end_ip, &_host_addr) == 0)
+       if (inet_pton(AF_INET, (const char *) end_ip, &_host_addr) != 1)
                return false;
 
        server->start_ip = start;
@@ -953,7 +959,7 @@
        if (unlikely(!server))
                return false;
 
-       if (inet_aton(ip, &ia) < 0)
+       if (inet_pton(AF_INET, ip, &ia) != 1)
                return false;
 
        server->address = ia.s_addr;
@@ -981,7 +987,7 @@
        if (unlikely(!server || !mask))
                return false;
 
-       if (inet_aton(mask, &ia) < 0)
+       if (inet_pton(AF_INET, mask, &ia) != 1)
                return false;
 
        server->netmask = ia.s_addr;
@@ -997,7 +1003,7 @@
        if (unlikely(!server || !ip))
                return false;
 
-       if (inet_aton(ip, &ia) < 0)
+       if (inet_pton(AF_INET, ip, &ia) != 1)
                return false;
 
        server->gateway = ia.s_addr;
@@ -1018,7 +1024,7 @@
        for (i = 0; dns[i]; i++) {
                struct in_addr ia;
 
-               if (inet_aton(dns[i], &ia) < 0)
+               if (inet_pton(AF_INET, dns[i], &ia) != 1)
                        goto failed;
 
                dns_list[i] = ia.s_addr;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/dhcp-transport.c new/ell-0.41/ell/dhcp-transport.c
--- old/ell-0.40/ell/dhcp-transport.c   2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/dhcp-transport.c   2021-06-11 20:09:50.000000000 +0200
@@ -169,8 +169,8 @@
        ip->tot_len = L_CPU_TO_BE16(len + sizeof(*ip) + sizeof(*udp));
 
        ip->protocol = IPPROTO_UDP;
-       ip->saddr = L_CPU_TO_BE32(saddr);
-       ip->daddr = L_CPU_TO_BE32(daddr);
+       ip->saddr = saddr;
+       ip->daddr = daddr;
 
        udp->source = L_CPU_TO_BE16(sport);
        udp->dest = L_CPU_TO_BE16(dport);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/dhcp.c new/ell-0.41/ell/dhcp.c
--- old/ell-0.40/ell/dhcp.c     2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/dhcp.c     2021-06-11 20:09:50.000000000 +0200
@@ -860,6 +860,8 @@
 
                dhcp_client_event_notify(client, r);
 
+               client->lease->bound_time = l_time_now();
+
                /*
                 * Start T1, once it expires we will start the T2 timer.  If
                 * we renew the lease, we will end up back here.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/ell.sym new/ell-0.41/ell/ell.sym
--- old/ell-0.40/ell/ell.sym    2021-05-02 13:06:43.000000000 +0200
+++ new/ell-0.41/ell/ell.sym    2021-06-11 20:09:50.000000000 +0200
@@ -589,6 +589,7 @@
        l_gpio_reader_get;
        /* rtnl */
        l_rtnl_address_new;
+       l_rtnl_address_clone;
        l_rtnl_address_free;
        l_rtnl_address_get_address;
        l_rtnl_address_get_family;
@@ -641,6 +642,7 @@
        l_rtnl_route6_delete_gateway;
        l_rtnl_route_add;
        l_rtnl_route_delete;
+       l_rtnl_ifaddr_extract;
        l_rtnl_ifaddr_add;
        l_rtnl_ifaddr_delete;
 /* icmp6 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/genl.c new/ell-0.41/ell/genl.c
--- old/ell-0.40/ell/genl.c     2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/genl.c     2021-06-11 20:09:50.000000000 +0200
@@ -696,14 +696,6 @@
        return notify->id == id;
 }
 
-static bool mcast_notify_match_by_hid(const void *a, const void *b)
-{
-       const struct mcast_notify *notify = a;
-       uint32_t id = L_PTR_TO_UINT(b);
-
-       return notify->handle_id == id;
-}
-
 static void mcast_notify_prune(struct l_genl *genl)
 {
        struct mcast_notify *notify;
@@ -1021,6 +1013,10 @@
                                                entry; entry = entry->next) {
                struct mcast_notify *notify = entry->data;
 
+               /* Skip those that might have been removed due this mcast */
+               if (!notify->id)
+                       continue;
+
                if (notify->type != nlmsg->nlmsg_type)
                        continue;
 
@@ -2087,8 +2083,8 @@
 {
        struct l_genl *genl;
        struct genl_request *req;
-       struct mcast_notify *notify;
        struct l_genl_family_info *info;
+       const struct l_queue_entry *entry;
 
        if (!family)
                return;
@@ -2096,6 +2092,7 @@
        genl = family->genl;
        info = l_queue_find(genl->family_infos, family_info_match,
                                        L_UINT_TO_PTR(family->id));
+       L_WARN_ON(!info);
 
        while ((req = l_queue_remove_if(genl->pending_list,
                                        match_request_hid,
@@ -2107,24 +2104,28 @@
                                        L_UINT_TO_PTR(family->handle_id))))
                destroy_request(req);
 
-       while ((notify = l_queue_remove_if(genl->notify_list,
-                                       mcast_notify_match_by_hid,
-                                       L_UINT_TO_PTR(family->handle_id)))) {
+       for (entry = l_queue_get_entries(genl->notify_list);
+                                               entry; entry = entry->next) {
+               struct mcast_notify *notify = entry->data;
 
-               struct genl_mcast *mcast;
+               if (notify->handle_id != family->handle_id)
+                       continue;
 
-               if (unlikely(L_WARN_ON(!info)))
-                       goto free_notify;
+               notify->id = 0;
 
-               mcast = l_queue_find(info->mcast_list, match_mcast_id,
+               if (info) {
+                       struct genl_mcast *mcast =
+                               l_queue_find(info->mcast_list, match_mcast_id,
                                                L_UINT_TO_PTR(notify->group));
-               if (mcast)
-                       drop_membership(genl, mcast);
 
-free_notify:
-               mcast_notify_free(notify);
+                       if (mcast)
+                               drop_membership(genl, mcast);
+               }
        }
 
+       if (!genl->in_mcast_notify)
+               mcast_notify_prune(genl);
+
        l_free(family);
        l_genl_unref(genl);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/queue.c new/ell-0.41/ell/queue.c
--- old/ell-0.40/ell/queue.c    2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/queue.c    2021-06-11 20:09:50.000000000 +0200
@@ -581,7 +581,7 @@
  * Returns: A pointer to the head of the queue.
  **/
 LIB_EXPORT const struct l_queue_entry *l_queue_get_entries(
-                                                       struct l_queue *queue)
+                                               const struct l_queue *queue)
 {
        if (unlikely(!queue))
                return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/queue.h new/ell-0.41/ell/queue.h
--- old/ell-0.40/ell/queue.h    2017-06-10 15:42:47.000000000 +0200
+++ new/ell-0.41/ell/queue.h    2021-06-11 20:09:50.000000000 +0200
@@ -73,7 +73,7 @@
 unsigned int l_queue_length(struct l_queue *queue);
 bool l_queue_isempty(struct l_queue *queue);
 
-const struct l_queue_entry *l_queue_get_entries(struct l_queue *queue);
+const struct l_queue_entry *l_queue_get_entries(const struct l_queue *queue);
 
 #ifdef __cplusplus
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/rtnl.c new/ell-0.41/ell/rtnl.c
--- old/ell-0.40/ell/rtnl.c     2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/rtnl.c     2021-06-11 20:09:50.000000000 +0200
@@ -146,6 +146,12 @@
        return addr;
 }
 
+LIB_EXPORT struct l_rtnl_address *l_rtnl_address_clone(
+                                       const struct l_rtnl_address *orig)
+{
+       return l_memdup(orig, sizeof(struct l_rtnl_address));
+}
+
 LIB_EXPORT void l_rtnl_address_free(struct l_rtnl_address *addr)
 {
        l_free(addr);
@@ -1126,6 +1132,59 @@
        return id;
 }
 
+LIB_EXPORT struct l_rtnl_address *l_rtnl_ifaddr_extract(
+                                               const struct ifaddrmsg *ifa,
+                                               int bytes)
+{
+       struct rtattr *attr;
+       struct ifa_cacheinfo *cinfo;
+       struct l_rtnl_address *addr;
+
+       if (unlikely(!ifa))
+               return NULL;
+
+       if (!L_IN_SET(ifa->ifa_family, AF_INET, AF_INET6))
+               return NULL;
+
+       addr = l_new(struct l_rtnl_address, 1);
+       addr->prefix_len = ifa->ifa_prefixlen;
+       addr->family = ifa->ifa_family;
+       addr->flags = ifa->ifa_flags;
+       addr->scope = ifa->ifa_scope;
+
+       for (attr = IFA_RTA(ifa); RTA_OK(attr, bytes);
+                                               attr = RTA_NEXT(attr, bytes)) {
+               switch (attr->rta_type) {
+               case IFA_LOCAL:
+                       if (ifa->ifa_family == AF_INET)
+                               addr->in_addr =
+                                       *((struct in_addr *) RTA_DATA(attr));
+
+                       break;
+               case IFA_ADDRESS:
+                       if (ifa->ifa_family == AF_INET6)
+                               addr->in6_addr =
+                                       *((struct in6_addr *) RTA_DATA(attr));
+
+                       break;
+               case IFA_BROADCAST:
+                       addr->broadcast = *((struct in_addr *) RTA_DATA(attr));
+                       break;
+               case IFA_LABEL:
+                       l_strlcpy(addr->label, RTA_DATA(attr),
+                                       sizeof(addr->label));
+                       break;
+               case IFA_CACHEINFO:
+                       cinfo = RTA_DATA(attr);
+                       addr->preferred_lifetime = cinfo->ifa_prefered;
+                       addr->valid_lifetime = cinfo->ifa_valid;
+                       break;
+               }
+       }
+
+       return addr;
+}
+
 LIB_EXPORT uint32_t l_rtnl_ifaddr_add(struct l_netlink *rtnl, int ifindex,
                                        const struct l_rtnl_address *addr,
                                        l_netlink_command_func_t cb,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/rtnl.h new/ell-0.41/ell/rtnl.h
--- old/ell-0.40/ell/rtnl.h     2020-11-29 22:35:22.000000000 +0100
+++ new/ell-0.41/ell/rtnl.h     2021-06-11 20:09:50.000000000 +0200
@@ -34,6 +34,7 @@
 struct l_rtnl_route;
 
 struct l_rtnl_address *l_rtnl_address_new(const char *ip, uint8_t prefix_len);
+struct l_rtnl_address *l_rtnl_address_clone(const struct l_rtnl_address *orig);
 void l_rtnl_address_free(struct l_rtnl_address *addr);
 bool l_rtnl_address_get_address(const struct l_rtnl_address *addr,
                                char *out_buf);
@@ -164,6 +165,9 @@
                                        void *user_data,
                                        l_netlink_destroy_func_t destroy);
 
+struct l_rtnl_address *l_rtnl_ifaddr_extract(const struct ifaddrmsg *ifa,
+                                                               int bytes);
+
 uint32_t l_rtnl_ifaddr_add(struct l_netlink *rtnl, int ifindex,
                                        const struct l_rtnl_address *addr,
                                        l_netlink_command_func_t cb,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/timeout.c new/ell-0.41/ell/timeout.c
--- old/ell-0.40/ell/timeout.c  2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/timeout.c  2021-06-11 20:09:50.000000000 +0200
@@ -96,10 +96,10 @@
        return timerfd_settime(fd, 0, &itimer, NULL);
 }
 
-static bool convert_ms(unsigned long milliseconds, unsigned int *seconds,
+static bool convert_ms(uint64_t milliseconds, unsigned int *seconds,
                        long *nanoseconds)
 {
-       unsigned long big_seconds = milliseconds / 1000;
+       uint64_t big_seconds = milliseconds / 1000;
 
        if (big_seconds > UINT_MAX)
                return false;
@@ -206,7 +206,7 @@
  * Returns: a newly allocated #l_timeout object. On failure, the function
  * returns NULL.
  **/
-LIB_EXPORT struct l_timeout *l_timeout_create_ms(unsigned long milliseconds,
+LIB_EXPORT struct l_timeout *l_timeout_create_ms(uint64_t milliseconds,
                        l_timeout_notify_cb_t callback,
                        void *user_data, l_timeout_destroy_cb_t destroy)
 {
@@ -252,7 +252,7 @@
  * Modify an existing @timeout and rearm it.
  **/
 LIB_EXPORT void l_timeout_modify_ms(struct l_timeout *timeout,
-                                       unsigned long milliseconds)
+                                       uint64_t milliseconds)
 {
        if (unlikely(!timeout))
                return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/timeout.h new/ell-0.41/ell/timeout.h
--- old/ell-0.40/ell/timeout.h  2019-05-11 21:15:54.000000000 +0200
+++ new/ell-0.41/ell/timeout.h  2021-06-11 20:09:50.000000000 +0200
@@ -27,6 +27,8 @@
 extern "C" {
 #endif
 
+#include <stdint.h>
+
 struct l_timeout;
 
 typedef void (*l_timeout_notify_cb_t) (struct l_timeout *timeout,
@@ -36,13 +38,13 @@
 struct l_timeout *l_timeout_create(unsigned int seconds,
                        l_timeout_notify_cb_t callback,
                        void *user_data, l_timeout_destroy_cb_t destroy);
-struct l_timeout *l_timeout_create_ms(unsigned long milliseconds,
+struct l_timeout *l_timeout_create_ms(uint64_t milliseconds,
                        l_timeout_notify_cb_t callback,
                        void *user_data, l_timeout_destroy_cb_t destroy);
 void l_timeout_modify(struct l_timeout *timeout,
                                unsigned int seconds);
 void l_timeout_modify_ms(struct l_timeout *timeout,
-                               unsigned long milliseconds);
+                               uint64_t milliseconds);
 void l_timeout_remove(struct l_timeout *timeout);
 void l_timeout_set_callback(struct l_timeout *timeout,
                                l_timeout_notify_cb_t callback, void *user_data,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/ell/useful.h new/ell-0.41/ell/useful.h
--- old/ell-0.40/ell/useful.h   2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.41/ell/useful.h   2021-06-11 20:09:50.000000000 +0200
@@ -52,6 +52,13 @@
        return (oct >> start) & mask;
 }
 
+#define DIV_ROUND_CLOSEST(x, divisor)                  \
+({                                                     \
+       typeof(divisor) _d = (divisor);                 \
+       typeof(x) _x = (x) + _d / 2;                    \
+       _x / _d;                                        \
+})
+
 #define __AUTODESTRUCT(var, func)                      \
        void cleanup_ ## var(void *ptr)                 \
        { func(*(void **) ptr); }                       \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ell-0.40/unit/test-dhcp.c new/ell-0.41/unit/test-dhcp.c
--- old/ell-0.40/unit/test-dhcp.c       2021-02-16 21:01:42.000000000 +0100
+++ new/ell-0.41/unit/test-dhcp.c       2021-06-11 20:09:50.000000000 +0200
@@ -988,20 +988,29 @@
                addr[5] = i;
                client = client_init(addr);
                client_connect(client, server);
+               l_free(new_client);
+               new_client = NULL;
 
-               l_dhcp_client_stop(client);
+               l_dhcp_client_destroy(client);
                srv_transport->rx_cb(client_packet, client_packet_len, server);
+               l_free(expired_client);
+               expired_client = NULL;
        }
 
        addr[5] = i + 1;
        client_new = client_init(addr);
        client_connect(client_new, server);
+       l_free(new_client);
+       new_client = NULL;
 
        lease = l_dhcp_client_get_lease(client_new);
        assert(lease);
        cli_addr = l_dhcp_lease_get_address(lease);
        assert(!strcmp(cli_addr, "192.168.1.2"));
        l_free(cli_addr);
+
+       l_dhcp_client_destroy(client_new);
+       l_dhcp_server_destroy(server);
 }
 
 int main(int argc, char *argv[])

Reply via email to