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-11-06 18:15:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ell (Old)
 and      /work/SRC/openSUSE:Factory/.ell.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ell"

Sat Nov  6 18:15:36 2021 rev:24 rq:929610 version:0.45

Changes:
--------
--- /work/SRC/openSUSE:Factory/ell/ell.changes  2021-09-25 00:35:55.367162474 
+0200
+++ /work/SRC/openSUSE:Factory/.ell.new.1890/ell.changes        2021-11-06 
18:17:55.672881352 +0100
@@ -1,0 +2,6 @@
+Fri Nov  5 06:09:08 UTC 2021 - Malte Ohmstede <malte.ohmst...@gmail.com>
+
+-update to release 0.45
+  * Fix issue with ICMPv6 and handling re-entrantly callbacks. 
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ ell.spec ++++++
--- /var/tmp/diff_new_pack.Wml8Bg/_old  2021-11-06 18:17:56.468881764 +0100
+++ /var/tmp/diff_new_pack.Wml8Bg/_new  2021-11-06 18:17:56.472881766 +0100
@@ -18,7 +18,7 @@
 
 %define lname   libell0
 Name:           ell
-Version:        0.44
+Version:        0.45
 Release:        0
 Summary:        Wireless setup and cryptography library
 License:        LGPL-2.1-or-later

++++++ ell-0.44.tar.xz -> ell-0.45.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ChangeLog new/ell-0.45/ChangeLog
--- old/ell-0.44/ChangeLog      2021-09-14 21:48:51.000000000 +0200
+++ new/ell-0.45/ChangeLog      2021-11-02 15:41:44.000000000 +0100
@@ -1,3 +1,6 @@
+ver 0.45:
+       Fix issue with ICMPv6 and handling re-entrantly callbacks.
+
 ver 0.44:
        Fix issue with allowing zero byte input for AEAD cipher.
        Fix issue with filling in DNS info in DHCP lease objects.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/Makefile.am new/ell-0.45/Makefile.am
--- old/ell-0.44/Makefile.am    2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.45/Makefile.am    2021-11-02 15:41:45.000000000 +0100
@@ -59,7 +59,8 @@
                        ell/path.h \
                        ell/icmp6.h \
                        ell/acd.h \
-                       ell/tester.h
+                       ell/tester.h \
+                       ell/cleanup.h
 
 lib_LTLIBRARIES = ell/libell.la
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/Makefile.in new/ell-0.45/Makefile.in
--- old/ell-0.44/Makefile.in    2021-09-14 21:50:32.000000000 +0200
+++ new/ell-0.45/Makefile.in    2021-11-02 15:45:44.000000000 +0100
@@ -987,7 +987,8 @@
                        ell/path.h \
                        ell/icmp6.h \
                        ell/acd.h \
-                       ell/tester.h
+                       ell/tester.h \
+                       ell/cleanup.h
 
 lib_LTLIBRARIES = ell/libell.la
 ell_libell_la_SOURCES = $(linux_headers) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/configure new/ell-0.45/configure
--- old/ell-0.44/configure      2021-09-14 21:50:27.000000000 +0200
+++ new/ell-0.45/configure      2021-11-02 15:45:38.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ell 0.44.
+# Generated by GNU Autoconf 2.69 for ell 0.45.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@
 # Identity of this package.
 PACKAGE_NAME='ell'
 PACKAGE_TARNAME='ell'
-PACKAGE_VERSION='0.44'
-PACKAGE_STRING='ell 0.44'
+PACKAGE_VERSION='0.45'
+PACKAGE_STRING='ell 0.45'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1350,7 +1350,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ell 0.44 to adapt to many kinds of systems.
+\`configure' configures ell 0.45 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1421,7 +1421,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ell 0.44:";;
+     short | recursive ) echo "Configuration of ell 0.45:";;
    esac
   cat <<\_ACEOF
 
@@ -1548,7 +1548,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ell configure 0.44
+ell configure 0.45
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1913,7 +1913,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ell $as_me 0.44, which was
+It was created by ell $as_me 0.45, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2776,7 +2776,7 @@
 
 # Define the identity of the package.
  PACKAGE='ell'
- VERSION='0.44'
+ VERSION='0.45'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -13646,7 +13646,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ell $as_me 0.44, which was
+This file was extended by ell $as_me 0.45, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -13712,7 +13712,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ell config.status 0.44
+ell config.status 0.45
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/configure.ac new/ell-0.45/configure.ac
--- old/ell-0.44/configure.ac   2021-09-14 21:48:51.000000000 +0200
+++ new/ell-0.45/configure.ac   2021-11-02 15:43:45.000000000 +0100
@@ -1,5 +1,5 @@
 AC_PREREQ(2.60)
-AC_INIT(ell, 0.44)
+AC_INIT(ell, 0.45)
 
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_AUX_DIR(build-aux)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/cert.h new/ell-0.45/ell/cert.h
--- old/ell-0.44/ell/cert.h     2021-02-04 17:11:59.000000000 +0100
+++ new/ell-0.45/ell/cert.h     2021-11-02 15:41:45.000000000 +0100
@@ -28,6 +28,7 @@
 #endif
 
 #include <stddef.h>
+#include <ell/cleanup.h>
 
 struct l_queue;
 struct l_cert;
@@ -42,6 +43,7 @@
 
 struct l_cert *l_cert_new_from_der(const uint8_t *buf, size_t buf_len);
 void l_cert_free(struct l_cert *cert);
+DEFINE_CLEANUP_FUNC(l_cert_free);
 
 const uint8_t *l_cert_get_der_data(struct l_cert *cert, size_t *out_len);
 const uint8_t *l_cert_get_dn(struct l_cert *cert, size_t *out_len);
@@ -49,6 +51,7 @@
 struct l_key *l_cert_get_pubkey(struct l_cert *cert);
 
 void l_certchain_free(struct l_certchain *chain);
+DEFINE_CLEANUP_FUNC(l_certchain_free);
 
 struct l_cert *l_certchain_get_leaf(struct l_certchain *chain);
 void l_certchain_walk_from_leaf(struct l_certchain *chain,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/cleanup.h new/ell-0.45/ell/cleanup.h
--- old/ell-0.44/ell/cleanup.h  1970-01-01 01:00:00.000000000 +0100
+++ new/ell-0.45/ell/cleanup.h  2021-11-02 15:41:45.000000000 +0100
@@ -0,0 +1,27 @@
+/*
+ *
+ *  Embedded Linux library
+ *
+ *  Copyright (C) 2021  Intel Corporation. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#pragma once
+
+#define DEFINE_CLEANUP_FUNC(func)                      \
+       inline __attribute__((always_inline))           \
+       void func ## _cleanup(void *p) { func(*(void **) p); }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/dhcp-lease.c 
new/ell-0.45/ell/dhcp-lease.c
--- old/ell-0.44/ell/dhcp-lease.c       2021-08-22 06:08:02.000000000 +0200
+++ new/ell-0.45/ell/dhcp-lease.c       2021-11-02 15:41:45.000000000 +0100
@@ -207,6 +207,15 @@
        return get_ip(lease->address);
 }
 
+LIB_EXPORT uint32_t l_dhcp_lease_get_address_u32(
+                                       const struct l_dhcp_lease *lease)
+{
+       if (unlikely(!lease))
+               return 0;
+
+       return lease->address;
+}
+
 LIB_EXPORT char *l_dhcp_lease_get_gateway(const struct l_dhcp_lease *lease)
 {
        if (unlikely(!lease))
@@ -215,6 +224,15 @@
        return get_ip(lease->router);
 }
 
+LIB_EXPORT uint32_t l_dhcp_lease_get_gateway_u32(
+                                       const struct l_dhcp_lease *lease)
+{
+       if (unlikely(!lease))
+               return 0;
+
+       return lease->router;
+}
+
 LIB_EXPORT char *l_dhcp_lease_get_netmask(const struct l_dhcp_lease *lease)
 {
        if (unlikely(!lease))
@@ -223,6 +241,34 @@
        return get_ip(lease->subnet_mask);
 }
 
+LIB_EXPORT uint32_t l_dhcp_lease_get_netmask_u32(
+                                       const struct l_dhcp_lease *lease)
+{
+       if (unlikely(!lease))
+               return 0;
+
+       return lease->subnet_mask;
+}
+
+LIB_EXPORT uint32_t l_dhcp_lease_get_prefix_length(
+                                       const struct l_dhcp_lease *lease)
+{
+       int pl;
+
+       if (unlikely(!lease))
+               return 0;
+
+       if (!lease->subnet_mask)
+               return 0;
+
+       pl = __builtin_popcount(lease->subnet_mask);
+
+       if (__builtin_ctz(L_BE32_TO_CPU(lease->subnet_mask)) != 32 - pl)
+               return 0;
+
+       return pl;
+}
+
 LIB_EXPORT char *l_dhcp_lease_get_broadcast(const struct l_dhcp_lease *lease)
 {
        if (unlikely(!lease))
@@ -239,6 +285,18 @@
        return get_ip(lease->server_address);
 }
 
+LIB_EXPORT const uint8_t *l_dhcp_lease_get_server_mac(
+                                       const struct l_dhcp_lease *lease)
+{
+       if (unlikely(!lease))
+               return NULL;
+
+       if (l_memeqzero(lease->server_mac, sizeof(lease->server_mac)))
+               return NULL;
+
+       return lease->server_mac;
+}
+
 LIB_EXPORT char **l_dhcp_lease_get_dns(const struct l_dhcp_lease *lease)
 {
        unsigned i;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/dhcp-private.h 
new/ell-0.45/ell/dhcp-private.h
--- old/ell-0.44/ell/dhcp-private.h     2021-08-22 06:08:02.000000000 +0200
+++ new/ell-0.45/ell/dhcp-private.h     2021-11-02 15:41:45.000000000 +0100
@@ -166,6 +166,7 @@
        uint64_t bound_time;
        uint32_t router;
        uint32_t *dns;
+       uint8_t server_mac[6];
        char *domain_name;
        /* for server */
        uint8_t mac[6];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/dhcp.c new/ell-0.45/ell/dhcp.c
--- old/ell-0.44/ell/dhcp.c     2021-08-22 06:08:02.000000000 +0200
+++ new/ell-0.45/ell/dhcp.c     2021-11-02 15:41:45.000000000 +0100
@@ -673,6 +673,7 @@
 }
 
 static int dhcp_client_receive_ack(struct l_dhcp_client *client,
+                                       const uint8_t *saddr,
                                        const struct dhcp_message *ack,
                                        size_t len)
 {
@@ -697,6 +698,9 @@
 
        lease->address = ack->yiaddr;
 
+       if (saddr)
+               memcpy(lease->server_mac, saddr, ETH_ALEN);
+
        r = L_DHCP_CLIENT_EVENT_LEASE_RENEWED;
 
        if (client->lease) {
@@ -721,15 +725,11 @@
                        l_dhcp_lease_get_address(client->lease);
                uint8_t prefix_len;
                uint32_t l = l_dhcp_lease_get_lifetime(client->lease);
-               L_AUTO_FREE_VAR(char *, netmask) =
-                               l_dhcp_lease_get_netmask(client->lease);
                L_AUTO_FREE_VAR(char *, broadcast) =
                                l_dhcp_lease_get_broadcast(client->lease);
-               struct in_addr in_addr;
 
-               if (inet_pton(AF_INET, netmask, &in_addr) > 0)
-                       prefix_len = __builtin_popcountl(in_addr.s_addr);
-               else
+               prefix_len = l_dhcp_lease_get_prefix_length(client->lease);
+               if (!prefix_len)
                        prefix_len = 24;
 
                a = l_rtnl_address_new(ip, prefix_len);
@@ -862,7 +862,7 @@
                if (msg_type != DHCP_MESSAGE_TYPE_ACK)
                        return;
 
-               r = dhcp_client_receive_ack(client, message, len);
+               r = dhcp_client_receive_ack(client, saddr, message, len);
                if (r < 0)
                        return;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/dhcp.h new/ell-0.45/ell/dhcp.h
--- old/ell-0.44/ell/dhcp.h     2021-08-22 06:08:02.000000000 +0200
+++ new/ell-0.45/ell/dhcp.h     2021-11-02 15:41:45.000000000 +0100
@@ -106,10 +106,15 @@
 
 
 char *l_dhcp_lease_get_address(const struct l_dhcp_lease *lease);
+uint32_t l_dhcp_lease_get_address_u32(const struct l_dhcp_lease *lease);
 char *l_dhcp_lease_get_gateway(const struct l_dhcp_lease *lease);
+uint32_t l_dhcp_lease_get_gateway_u32(const struct l_dhcp_lease *lease);
 char *l_dhcp_lease_get_netmask(const struct l_dhcp_lease *lease);
+uint32_t l_dhcp_lease_get_netmask_u32(const struct l_dhcp_lease *lease);
+uint32_t l_dhcp_lease_get_prefix_length(const struct l_dhcp_lease *lease);
 char *l_dhcp_lease_get_broadcast(const struct l_dhcp_lease *lease);
 char *l_dhcp_lease_get_server_id(const struct l_dhcp_lease *lease);
+const uint8_t *l_dhcp_lease_get_server_mac(const struct l_dhcp_lease *lease);
 char **l_dhcp_lease_get_dns(const struct l_dhcp_lease *lease);
 char *l_dhcp_lease_get_domain_name(const struct l_dhcp_lease *lease);
 const uint8_t *l_dhcp_lease_get_mac(const struct l_dhcp_lease *lease);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/ecc.h new/ell-0.45/ell/ecc.h
--- old/ell-0.44/ell/ecc.h      2021-08-01 21:49:37.000000000 +0200
+++ new/ell-0.45/ell/ecc.h      2021-11-02 15:41:45.000000000 +0100
@@ -28,6 +28,7 @@
 #endif
 
 #include <sys/types.h> // for ssize_t
+#include <ell/cleanup.h>
 
 #define L_ECC_MAX_DIGITS 6
 #define L_ECC_SCALAR_MAX_BYTES         L_ECC_MAX_DIGITS * 8
@@ -71,6 +72,7 @@
 
 ssize_t l_ecc_point_get_data(const struct l_ecc_point *p, void *buf, size_t 
len);
 void l_ecc_point_free(struct l_ecc_point *p);
+DEFINE_CLEANUP_FUNC(l_ecc_point_free);
 
 struct l_ecc_scalar *l_ecc_scalar_new(const struct l_ecc_curve *curve,
                                                const void *buf, size_t len);
@@ -84,6 +86,7 @@
 ssize_t l_ecc_scalar_get_data(const struct l_ecc_scalar *c, void *buf,
                                        size_t len);
 void l_ecc_scalar_free(struct l_ecc_scalar *c);
+DEFINE_CLEANUP_FUNC(l_ecc_scalar_free);
 
 /* Constant operations */
 bool l_ecc_scalar_add(struct l_ecc_scalar *ret, const struct l_ecc_scalar *a,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/ell.sym new/ell-0.45/ell/ell.sym
--- old/ell-0.44/ell/ell.sym    2021-09-14 21:48:51.000000000 +0200
+++ new/ell-0.45/ell/ell.sym    2021-11-02 15:41:45.000000000 +0100
@@ -40,6 +40,7 @@
        l_strv_append_printf;
        l_strv_append_vprintf;
        l_strv_copy;
+       l_strv_eq;
        /* utf8 */
        l_ascii_table;
        l_utf8_get_codepoint;
@@ -224,11 +225,16 @@
        l_dbus_name_acquire;
        /* dhcp */
        l_dhcp_lease_get_address;
+       l_dhcp_lease_get_address_u32;
        l_dhcp_lease_get_gateway;
+       l_dhcp_lease_get_gateway_u32;
        l_dhcp_lease_get_mac;
        l_dhcp_lease_get_netmask;
+       l_dhcp_lease_get_netmask_u32;
+       l_dhcp_lease_get_prefix_length;
        l_dhcp_lease_get_broadcast;
        l_dhcp_lease_get_server_id;
+       l_dhcp_lease_get_server_mac;
        l_dhcp_lease_get_dns;
        l_dhcp_lease_get_domain_name;
        l_dhcp_lease_get_t1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/icmp6.c new/ell-0.45/ell/icmp6.c
--- old/ell-0.44/ell/icmp6.c    2021-08-01 21:49:37.000000000 +0200
+++ new/ell-0.45/ell/icmp6.c    2021-11-02 15:41:45.000000000 +0100
@@ -344,6 +344,11 @@
                client->ra = r;
                icmp6_client_event_notify(client,
                                        L_ICMP6_CLIENT_EVENT_ROUTER_FOUND);
+
+               /* DHCP6 client may have stopped us */
+               if (!client->ra)
+                       return -ECANCELED;
+
                icmp6_client_setup_routes(client);
                return 0;
        }
@@ -364,6 +369,7 @@
        struct nd_router_advert *ra;
        ssize_t l;
        struct in6_addr src;
+       int r;
 
        /* Poke to see how many bytes we need to read / alloc */
        l = recv(s, NULL, 0, MSG_PEEK|MSG_TRUNC);
@@ -382,7 +388,10 @@
                goto done;
        }
 
-       if (icmp6_client_handle_message(client, ra, l, &src) < 0)
+       r = icmp6_client_handle_message(client, ra, l, &src);
+       if (r == -ECANCELED)
+               return true;
+       else if (r < 0)
                goto done;
 
        /* Stop solicitations */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/key.h new/ell-0.45/ell/key.h
--- old/ell-0.44/ell/key.h      2019-04-03 19:49:21.000000000 +0200
+++ new/ell-0.45/ell/key.h      2021-11-02 15:41:45.000000000 +0100
@@ -30,6 +30,7 @@
 #include <stddef.h>
 #include <stdbool.h>
 
+#include <ell/cleanup.h>
 #include <ell/checksum.h>
 
 struct l_key;
@@ -108,7 +109,9 @@
                        const struct l_keyring *trust);
 
 void l_keyring_free(struct l_keyring *keyring);
+DEFINE_CLEANUP_FUNC(l_keyring_free);
 void l_keyring_free_norevoke(struct l_keyring *keyring);
+DEFINE_CLEANUP_FUNC(l_keyring_free_norevoke);
 
 bool l_keyring_link(struct l_keyring *keyring, const struct l_key *key);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/rtnl.h new/ell-0.45/ell/rtnl.h
--- old/ell-0.44/ell/rtnl.h     2021-09-14 21:48:51.000000000 +0200
+++ new/ell-0.45/ell/rtnl.h     2021-11-02 15:41:45.000000000 +0100
@@ -25,6 +25,7 @@
 
 #include <stdint.h>
 #include <linux/rtnetlink.h>
+#include <ell/cleanup.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -40,6 +41,7 @@
 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);
+DEFINE_CLEANUP_FUNC(l_rtnl_address_free);
 bool l_rtnl_address_get_address(const struct l_rtnl_address *addr,
                                char *out_buf);
 uint8_t l_rtnl_address_get_family(const struct l_rtnl_address *addr);
@@ -64,6 +66,7 @@
 struct l_rtnl_route *l_rtnl_route_new_prefix(const char *ip,
                                                        uint8_t prefix_len);
 void l_rtnl_route_free(struct l_rtnl_route *rt);
+DEFINE_CLEANUP_FUNC(l_rtnl_route_free);
 uint8_t l_rtnl_route_get_family(const struct l_rtnl_route *rt);
 bool l_rtnl_route_get_gateway(const struct l_rtnl_route *rt, char *out_buf);
 uint32_t l_rtnl_route_get_lifetime(const struct l_rtnl_route *rt);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/settings.h new/ell-0.45/ell/settings.h
--- old/ell-0.44/ell/settings.h 2021-05-02 13:06:43.000000000 +0200
+++ new/ell-0.45/ell/settings.h 2021-11-02 15:41:45.000000000 +0100
@@ -25,6 +25,7 @@
 
 #include <stdbool.h>
 #include <stddef.h>
+#include <ell/cleanup.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -37,6 +38,7 @@
 
 struct l_settings *l_settings_new(void);
 void l_settings_free(struct l_settings *settings);
+DEFINE_CLEANUP_FUNC(l_settings_free);
 
 bool l_settings_load_from_data(struct l_settings *settings,
                                                const char *data, size_t len);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/string.h new/ell-0.45/ell/string.h
--- old/ell-0.44/ell/string.h   2020-04-14 20:24:28.000000000 +0200
+++ new/ell-0.45/ell/string.h   2021-11-02 15:41:45.000000000 +0100
@@ -24,6 +24,7 @@
 #define __ELL_STRING_H
 
 #include <stdarg.h>
+#include <ell/cleanup.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -33,6 +34,7 @@
 
 struct l_string *l_string_new(size_t initial_length);
 void l_string_free(struct l_string *string);
+DEFINE_CLEANUP_FUNC(l_string_free);
 char *l_string_unwrap(struct l_string *string);
 
 struct l_string *l_string_append(struct l_string *dest, const char *src);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/strv.c new/ell-0.45/ell/strv.c
--- old/ell-0.44/ell/strv.c     2021-03-29 14:19:13.000000000 +0200
+++ new/ell-0.45/ell/strv.c     2021-11-02 15:41:45.000000000 +0100
@@ -359,3 +359,23 @@
 
        return copy;
 }
+
+/**
+ * l_strv_eq:
+ * @a: a %NULL terminated array of strings or %NULL
+ * @b: another %NULL terminated array of strings or %NULL
+ *
+ * Returns: Whether @a and @b's contents are identical, including the
+ * order, or @a and @b are both %NULL.
+ */
+LIB_EXPORT bool l_strv_eq(char **a, char **b)
+{
+       if (!a || !b)
+               return a == b;
+
+       for (; *a; a++, b++)
+               if (!*b || strcmp(*a, *b))
+                       return false;
+
+       return !*b;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/strv.h new/ell-0.45/ell/strv.h
--- old/ell-0.44/ell/strv.h     2020-11-29 22:35:22.000000000 +0100
+++ new/ell-0.45/ell/strv.h     2021-11-02 15:41:45.000000000 +0100
@@ -25,6 +25,7 @@
 
 #include <stdarg.h>
 #include <stdbool.h>
+#include <ell/cleanup.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -37,6 +38,7 @@
 
 char **l_strv_new(void);
 void l_strv_free(char **str_array);
+DEFINE_CLEANUP_FUNC(l_strv_free);
 unsigned int l_strv_length(char **str_array);
 bool l_strv_contains(char **str_array, const char *item);
 char **l_strv_append(char **str_array, const char *str);
@@ -46,6 +48,7 @@
                                                        va_list args)
                                        __attribute__((format(printf, 2, 0)));
 char **l_strv_copy(char **str_array);
+bool l_strv_eq(char **a, char **b);
 
 #ifdef __cplusplus
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/uintset.h new/ell-0.45/ell/uintset.h
--- old/ell-0.44/ell/uintset.h  2020-09-05 09:26:19.000000000 +0200
+++ new/ell-0.45/ell/uintset.h  2021-11-02 15:41:45.000000000 +0100
@@ -30,6 +30,7 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <stdbool.h>
+#include <ell/cleanup.h>
 
 typedef void (*l_uintset_foreach_func_t) (uint32_t number, void *user_data);
 
@@ -38,6 +39,7 @@
 struct l_uintset *l_uintset_new_from_range(uint32_t min, uint32_t max);
 struct l_uintset *l_uintset_new(unsigned int size);
 void l_uintset_free(struct l_uintset *set);
+DEFINE_CLEANUP_FUNC(l_uintset_free);
 
 bool l_uintset_contains(struct l_uintset *set, uint32_t number);
 bool l_uintset_take(struct l_uintset *set, uint32_t number);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/useful.h new/ell-0.45/ell/useful.h
--- old/ell-0.44/ell/useful.h   2021-09-14 21:48:51.000000000 +0200
+++ new/ell-0.45/ell/useful.h   2021-11-02 15:41:45.000000000 +0100
@@ -59,16 +59,11 @@
        _x / _d;                                        \
 })
 
-#define __AUTODESTRUCT(var, func)                      \
-       void cleanup_ ## var(void *ptr)                 \
-       { func(*(void **) ptr); }                       \
-       __attribute((cleanup(cleanup_ ## var)))
-
-#define _AUTODESTRUCT(var, func)                       \
-       __AUTODESTRUCT(var, func)
+#define __AUTODESTRUCT(func)                           \
+       __attribute((cleanup(func ## _cleanup)))
 
 #define _auto_(func)                                   \
-       _AUTODESTRUCT(__COUNTER__, func)
+       __AUTODESTRUCT(func)
 
 /*
  * Trick the compiler into thinking that var might be changed somehow by
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/ell/util.h new/ell-0.45/ell/util.h
--- old/ell-0.44/ell/util.h     2021-08-01 21:49:37.000000000 +0200
+++ new/ell-0.45/ell/util.h     2021-11-02 15:41:45.000000000 +0100
@@ -30,6 +30,7 @@
 #include <endian.h>
 #include <byteswap.h>
 #include <sys/uio.h>
+#include <ell/cleanup.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -235,6 +236,7 @@
 void *l_memdup(const void *mem, size_t size)
                        __attribute__ ((warn_unused_result, malloc));
 void l_free(void *ptr);
+DEFINE_CLEANUP_FUNC(l_free);
 
 void *l_realloc(void *mem, size_t size)
                        __attribute__ ((warn_unused_result, malloc));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ell-0.44/unit/test-dhcp.c 
new/ell-0.45/unit/test-dhcp.c
--- old/ell-0.44/unit/test-dhcp.c       2021-08-22 06:08:02.000000000 +0200
+++ new/ell-0.45/unit/test-dhcp.c       2021-11-02 15:41:45.000000000 +0100
@@ -945,6 +945,8 @@
        assert(!strcmp(tmp_addr, "255.255.255.0"));
        l_free(tmp_addr);
 
+       assert(l_dhcp_lease_get_prefix_length(cli_lease) == 24);
+
        dns_list = l_dhcp_lease_get_dns(cli_lease);
        assert(dns_list && dns_list[0] && dns_list[1]);
        assert(!strcmp(dns_list[0], "192.168.1.1"));

Reply via email to