Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gensio for openSUSE:Factory checked 
in at 2021-11-21 23:52:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gensio (Old)
 and      /work/SRC/openSUSE:Factory/.gensio.new.1895 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gensio"

Sun Nov 21 23:52:14 2021 rev:16 rq:932760 version:2.3.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/gensio/gensio.changes    2021-11-20 
02:40:24.788528128 +0100
+++ /work/SRC/openSUSE:Factory/.gensio.new.1895/gensio.changes  2021-11-21 
23:52:43.226148802 +0100
@@ -1,0 +2,6 @@
+Sat Nov 20 10:43:44 UTC 2021 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 2.3.5
+  * Bugfix release
+
+-------------------------------------------------------------------

Old:
----
  gensio-2.3.4.tar.gz

New:
----
  gensio-2.3.5.tar.gz

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

Other differences:
------------------
++++++ gensio.spec ++++++
--- /var/tmp/diff_new_pack.c29jjD/_old  2021-11-21 23:52:43.746147126 +0100
+++ /var/tmp/diff_new_pack.c29jjD/_new  2021-11-21 23:52:43.746147126 +0100
@@ -25,7 +25,7 @@
 %bcond_with    openipmi
 %endif
 Name:           gensio
-Version:        2.3.4
+Version:        2.3.5
 Release:        0
 Summary:        Library to abstract stream and packet I/O
 # examples/* is licenced under Apache-2.0

++++++ gensio-2.3.4.tar.gz -> gensio-2.3.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.3.4/CMakeLists.txt 
new/gensio-2.3.5/CMakeLists.txt
--- old/gensio-2.3.4/CMakeLists.txt     2021-11-16 18:08:46.000000000 +0100
+++ new/gensio-2.3.5/CMakeLists.txt     2021-11-19 04:59:20.000000000 +0100
@@ -2,7 +2,7 @@
 
 cmake_policy(SET CMP0078 NEW) # For swig
 
-project(gensio VERSION 2.3.4)
+project(gensio VERSION 2.3.5)
 set (gensio_VERSION_STRING 
"${gensio_VERSION_MAJOR}.${gensio_VERSION_MINOR}.${gensio_VERSION_PATCH}")
 
 include_directories("${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/include"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.3.4/README.rst new/gensio-2.3.5/README.rst
--- old/gensio-2.3.4/README.rst 2021-11-16 18:08:46.000000000 +0100
+++ new/gensio-2.3.5/README.rst 2021-11-19 04:59:20.000000000 +0100
@@ -46,6 +46,7 @@
 * openssl dev libraries and executable - For all the crypto
 
 * openipmi dev libraries - For IPMI serial over lan, if you want that.
+  Note that you need a pretty recent one, really 2.0.31 or newer.
 
 * libsctp dev library - For sctp support
 
@@ -57,11 +58,15 @@
 
 * libwrap - for tcpd
 
+* glib dev - for the glib os funcs
+
+* tcl dev - for the tcl os funcs
+
 The following sets everything except openipmi up on ubuntu 20.04:
 
-  sudo apt install gcc git swig python3-dev libssl-dev pkg-config      \
+  sudo apt install gcc g++ git swig python3-dev libssl-dev pkg-config  \
     libavahi-client-dev avahi-daemon libtool autoconf automake make    \
-    libsctp-dev libpam-dev libwrap0-dev
+    libsctp-dev libpam-dev libwrap0-dev libglib2.0-dev tcl-dev         \
 
 Handling python installation configuration is a bit of a pain.  By
 default the build scripts will put it wherever the python program
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.3.4/c++/tests/basic_cpp_test.cc 
new/gensio-2.3.5/c++/tests/basic_cpp_test.cc
--- old/gensio-2.3.4/c++/tests/basic_cpp_test.cc        2021-11-16 
18:08:46.000000000 +0100
+++ new/gensio-2.3.5/c++/tests/basic_cpp_test.cc        2021-11-19 
04:59:20.000000000 +0100
@@ -322,6 +322,13 @@
        if (portfound)
            return 0;
 
+       if (err) {
+           io->set_read_callback_enable(false);
+           waiter->wake();
+           errstr = "subprogram failed before reading port";
+           return 0;
+       }
+
        for (i = 0; i < *buflen; i++) {
            if (portpos >= sizeof(port)) {
                errstr = "Port from sub too large";
@@ -374,7 +381,7 @@
        Waiter w(o);
        Sub_Event se(&w);
        gensio_time waittime = { 2, 0 };
-       int err, err2;
+       int err2;
 
        cout << "Starting subprogram to act as a server" << endl;
        s = gensio_quote_string(o, argv[0]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.3.4/configure.ac 
new/gensio-2.3.5/configure.ac
--- old/gensio-2.3.4/configure.ac       2021-11-16 18:08:46.000000000 +0100
+++ new/gensio-2.3.5/configure.ac       2021-11-19 04:59:20.000000000 +0100
@@ -1,7 +1,7 @@
-AC_INIT([gensio],[2.3.4],[miny...@acm.org])
+AC_INIT([gensio],[2.3.5],[miny...@acm.org])
 AC_SUBST(gensio_VERSION_MAJOR, 2)
 AC_SUBST(gensio_VERSION_MINOR, 3)
-AC_SUBST(gensio_VERSION_PATCH, 4)
+AC_SUBST(gensio_VERSION_PATCH, 5)
 AC_SUBST(gensio_VERSION_STRING, ${PACKAGE_VERSION})
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([-Wall])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.3.4/include/gensio/gensio_err.h 
new/gensio-2.3.5/include/gensio/gensio_err.h
--- old/gensio-2.3.4/include/gensio/gensio_err.h        2021-11-16 
18:08:46.000000000 +0100
+++ new/gensio-2.3.5/include/gensio/gensio_err.h        2021-11-19 
04:59:20.000000000 +0100
@@ -69,8 +69,18 @@
  */
 #define GE_USER_ERR_START      1000000
 
+#ifndef __func__ /* Just in case */
+# if __STDC_VERSION__ < 199901L
+#  if __GNUC__ >= 2
+#   define __func__ __FUNCTION__
+#  else
+#   define __func__ "<unknown>"
+#  endif
+# endif
+#endif
+
 #define gensio_os_err_to_err(o, oserr)                                 \
-    gensio_i_os_err_to_err(o, oserr, __FUNCTION__, __FILE__, __LINE__)
+    gensio_i_os_err_to_err(o, oserr, __func__, __FILE__, __LINE__)
 
 GENSIO_DLL_PUBLIC
 const char *gensio_err_to_str(int err);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.3.4/lib/gensio_addrinfo.c 
new/gensio-2.3.5/lib/gensio_addrinfo.c
--- old/gensio-2.3.4/lib/gensio_addrinfo.c      2021-11-16 18:08:46.000000000 
+0100
+++ new/gensio-2.3.5/lib/gensio_addrinfo.c      2021-11-19 04:59:20.000000000 
+0100
@@ -72,10 +72,6 @@
     addr->curr = ai;
 }
 
-static int addrinfo_list_dup(struct gensio_os_funcs *o,
-                            struct addrinfo *ai, struct addrinfo **rai,
-                            struct addrinfo **rpai);
-
 static struct gensio_addr_addrinfo *
 gensio_addrinfo_make(struct gensio_os_funcs *o, unsigned int size,
                     bool is_recvfrom)
@@ -484,6 +480,136 @@
 }
 #endif
 
+static void
+addrinfo_item_free(struct gensio_os_funcs *o, struct addrinfo *ai)
+{
+    if (ai->ai_addr)
+       o->free(o, ai->ai_addr);
+    if (ai->ai_canonname)
+       o->free(o, ai->ai_canonname);
+    o->free(o, ai);
+}
+
+static void
+addrinfo_list_free(struct gensio_os_funcs *o, struct addrinfo *ai)
+{
+    struct addrinfo *tai;
+
+    while (ai) {
+       tai = ai->ai_next;
+       addrinfo_item_free(o, ai);
+       ai = tai;
+    }
+}
+
+static struct addrinfo *
+addrinfo_dup(struct gensio_os_funcs *o, struct addrinfo *iai)
+{
+    struct addrinfo *aic;
+
+    aic = o->zalloc(o, sizeof(*aic));
+    if (!aic)
+       return NULL;
+    memcpy(aic, iai, sizeof(*aic));
+    aic->ai_next = NULL;
+    aic->ai_addr = o->zalloc(o, iai->ai_addrlen);
+    if (!aic->ai_addr)
+       goto err;
+    memcpy(aic->ai_addr, iai->ai_addr, iai->ai_addrlen);
+    if (iai->ai_canonname) {
+       aic->ai_canonname = gensio_strdup(o, iai->ai_canonname);
+       if (!aic->ai_canonname)
+           goto err;
+    }
+
+    return aic;
+ err:
+    addrinfo_item_free(o, aic);
+    return NULL;
+}
+
+/*
+ * Duplicate list ai.  If rpai is set, it is a pointer to the last
+ * element of another list, add the duplicated list onto the end of
+ * that list.  Return the duplicated list in rai if it is set.
+ */
+static int
+addrinfo_list_dup(struct gensio_os_funcs *o,
+                 struct addrinfo *ai, struct addrinfo **rai,
+                 struct addrinfo **rpai)
+{
+    struct addrinfo *cai, *pai = NULL, *tai = NULL;
+
+    if (!rpai && !rai)
+       return GE_INVAL;
+
+    while (ai) {
+       cai = addrinfo_dup(o, ai);
+       if (!cai)
+           goto out_nomem;
+       if (!tai)
+           tai = cai;
+       else
+           pai->ai_next = cai;
+       pai = cai;
+       ai = ai->ai_next;
+    }
+
+    if (rai)
+       *rai = tai;
+    if (rpai) {
+       if (*rpai)
+           (*rpai)->ai_next = tai;
+       *rpai = pai;
+    }
+
+    return 0;
+out_nomem:
+    addrinfo_list_free(o, tai);
+    return GE_NOMEM;
+}
+
+static int
+gensio_addr_dedup(struct gensio_os_funcs *o,
+                 struct gensio_addr_addrinfo **iaddr)
+{
+    struct gensio_addr_addrinfo *addr = *iaddr;
+    struct addrinfo *ai, *ai2, *pai;
+
+ restart:
+    for (ai = addr->a; ai; ai = ai->ai_next) {
+       for (ai2 = ai->ai_next, pai = ai; ai2; pai = ai2, ai2 = ai2->ai_next) {
+           if (sockaddr_equal(ai->ai_addr, ai->ai_addrlen,
+                              ai2->ai_addr, ai2->ai_addrlen,
+                              true)) {
+               if (addr->is_getaddrinfo) {
+                   int err;
+
+                   /*
+                    * To delete the dup, we need to convert it into a
+                    * list not allocated by getaddrinfo so we can
+                    * modify it.
+                    */
+                   err = addrinfo_list_dup(o, addr->a, &ai, NULL);
+                   if (err)
+                       return err;
+                   freeaddrinfo(addr->a);
+                   addr->is_getaddrinfo = false;
+                   addr->a = ai;
+                   addr->curr = ai;
+                   goto restart;
+               }
+               pai->ai_next = ai2->ai_next;
+               addrinfo_item_free(o, ai2);
+               ai2 = pai;
+           }
+       }
+    }
+
+    *iaddr = addr;
+    return 0;
+}
+
 static int
 gensio_addr_addrinfo_scan_ips(struct gensio_os_funcs *o, const char *str,
                              bool listen, int ifamily,
@@ -724,7 +850,9 @@
     if (is_port_set)
        *is_port_set = portset;
 
-    *raddr = &addr->r;
+    rv = gensio_addr_dedup(o, &addr);
+    if (!rv)
+       *raddr = &addr->r;
 
  out_err:
     if (ai)
@@ -736,80 +864,6 @@
     return rv;
 }
 
-static struct addrinfo *
-addrinfo_dup(struct gensio_os_funcs *o, struct addrinfo *iai)
-{
-    struct addrinfo *aic;
-
-    aic = o->zalloc(o, sizeof(*aic));
-    if (!aic)
-       return NULL;
-    memcpy(aic, iai, sizeof(*aic));
-    aic->ai_next = NULL;
-    aic->ai_addr = o->zalloc(o, iai->ai_addrlen);
-    if (!aic->ai_addr) {
-       o->free(o, aic);
-       return NULL;
-    }
-    memcpy(aic->ai_addr, iai->ai_addr, iai->ai_addrlen);
-    if (iai->ai_canonname) {
-       aic->ai_canonname = gensio_strdup(o, iai->ai_canonname);
-       if (!aic->ai_canonname) {
-           o->free(o, aic->ai_addr);
-           o->free(o, aic);
-           return NULL;
-       }
-    }
-
-    return aic;
-}
-
-static void
-addrinfo_list_free(struct gensio_os_funcs *o, struct addrinfo *ai)
-{
-    struct addrinfo *tai;
-
-    while (ai) {
-       tai = ai->ai_next;
-       if (ai->ai_addr)
-           o->free(o, ai->ai_addr);
-       if (ai->ai_canonname)
-           o->free(o, ai->ai_canonname);
-       o->free(o, ai);
-       ai = tai;
-    }
-}
-
-static int
-addrinfo_list_dup(struct gensio_os_funcs *o,
-                 struct addrinfo *ai, struct addrinfo **rai,
-                 struct addrinfo **rpai)
-{
-    struct addrinfo *cai, *pai = NULL;
-
-    if (rpai)
-       pai = *rpai;
-    else if (!rai)
-       return GE_INVAL;
-
-    while (ai) {
-       cai = addrinfo_dup(o, ai);
-       if (!cai)
-           return GE_NOMEM;
-       if (pai)
-           pai->ai_next = cai;
-       else if (rai)
-           *rai = cai;
-       pai = cai;
-       ai = ai->ai_next;
-    }
-
-    if (rpai)
-       *rpai = pai;
-
-    return 0;
-}
-
 static struct gensio_addr *
 gensio_addr_addrinfo_dup(const struct gensio_addr *iaaddr)
 {
@@ -884,6 +938,10 @@
     if (rv)
        goto out_err;
 
+    rv = gensio_addr_dedup(o, &addr);
+    if (rv)
+       goto out_err;
+
     addr->curr = addr->a;
 
     return &addr->r;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gensio-2.3.4/lib/gensio_stdsock.c 
new/gensio-2.3.5/lib/gensio_stdsock.c
--- old/gensio-2.3.4/lib/gensio_stdsock.c       2021-11-16 18:08:46.000000000 
+0100
+++ new/gensio-2.3.5/lib/gensio_stdsock.c       2021-11-19 04:59:20.000000000 
+0100
@@ -23,6 +23,7 @@
 #define SOCK_EAGAIN WSAEWOULDBLOCK
 #define SOCK_EADDRINUSE WSAEADDRINUSE
 #define SOCK_EPIPE WSAECONNRESET
+#define SOCK_EINVAL WSAEINVAL
 #else
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -40,6 +41,7 @@
 #define SOCK_EAGAIN EWOULDBLOCK
 #define SOCK_EADDRINUSE EADDRINUSE
 #define SOCK_EPIPE EPIPE
+#define SOCK_EINVAL EINVAL
 #endif
 #if HAVE_UNIX
 #include <sys/un.h>
@@ -340,7 +342,7 @@
 }
 
 #if HAVE_SCTP_SENDV
-#define gensio_os_sctp_send l_gensio_os_sctp_send
+#define gensio_stdsock_sctp_send l_gensio_stdsock_sctp_send
 #endif
 
 static int
@@ -370,7 +372,7 @@
 }
 
 #if HAVE_SCTP_SENDV
-#undef gensio_os_sctp_send
+#undef gensio_stdsock_sctp_send
 static bool sctp_sendv_broken;
 static int
 gensio_stdsock_sctp_send(struct gensio_iod *iod,
@@ -387,8 +389,7 @@
 
     if (sctp_sendv_broken) {
     broken:
-       return l_gensio_os_sctp_send(o, o->iod_get_fd(iod),
-                                    sg, sglen, rcount, sinfo, flags);
+       return l_gensio_stdsock_sctp_send(iod, sg, sglen, rcount, sinfo, flags);
     }
     if (sinfo) {
        sdata.snd_sid = sinfo->sinfo_stream;
@@ -496,11 +497,13 @@
            goto out_err;
     }
     err = sctp_connectx(o->iod_get_fd(iod), saddrs, naddrs, NULL);
+    if (err == -1)
+       err = gensio_os_err_to_err(o, sock_errno);
+    else
+       err = 0;
  out_err:
     o->free(o, saddrs);
-    if (err == -1)
-       return gensio_os_err_to_err(o, sock_errno);
-    return 0;
+    return err;
 }
 
 static int
@@ -922,14 +925,14 @@
     if (rv >= 0) {
        gsi = o->zalloc(o, sizeof(*gsi));
        if (!gsi) {
-           close(rv);
+           close_socket(o, rv);
            err = GE_NOMEM;
            goto out;
        }
 
        err = o->add_iod(o, GENSIO_IOD_SOCKET, rv, &riod);
        if (err) {
-           close(rv);
+           close_socket(o, rv);
            goto out;
        }
 

Reply via email to