Hello community,

here is the log from the commit of package wireguard-tools for openSUSE:Factory 
checked in at 2020-05-14 23:27:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wireguard-tools (Old)
 and      /work/SRC/openSUSE:Factory/.wireguard-tools.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wireguard-tools"

Thu May 14 23:27:56 2020 rev:6 rq:805627 version:1.0.20200513

Changes:
--------
--- /work/SRC/openSUSE:Factory/wireguard-tools/wireguard-tools.changes  
2020-05-11 16:30:49.862459214 +0200
+++ 
/work/SRC/openSUSE:Factory/.wireguard-tools.new.2738/wireguard-tools.changes    
    2020-05-14 23:28:00.669402185 +0200
@@ -1,0 +2,7 @@
+Thu May 14 14:45:48 UTC 2020 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 1.0.20200513
+  * Makefile: remember to install all systemd units
+  * ipc: openbsd: switch to array ioctl interface
+
+-------------------------------------------------------------------

Old:
----
  wireguard-tools-1.0.20200510.tar.asc
  wireguard-tools-1.0.20200510.tar.xz

New:
----
  wireguard-tools-1.0.20200513.tar.asc
  wireguard-tools-1.0.20200513.tar.xz

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

Other differences:
------------------
++++++ wireguard-tools.spec ++++++
--- /var/tmp/diff_new_pack.nxa4Kf/_old  2020-05-14 23:28:01.385403748 +0200
+++ /var/tmp/diff_new_pack.nxa4Kf/_new  2020-05-14 23:28:01.389403756 +0200
@@ -18,7 +18,7 @@
 
 
 Name:           wireguard-tools
-Version:        1.0.20200510
+Version:        1.0.20200513
 Release:        0
 Summary:        WireGuard userspace tools
 License:        GPL-2.0-only
@@ -61,7 +61,6 @@
     WITH_WGQUICK=yes \
     WITH_SYSTEMDUNITS=yes
 
-install -D -m0644 systemd/wg-quick.target 
%{buildroot}%{_unitdir}/wg-quick.target
 install -d %{buildroot}/%{_sysconfdir}/wireguard/
 
 %pre


++++++ wireguard-tools-1.0.20200510.tar.xz -> 
wireguard-tools-1.0.20200513.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireguard-tools-1.0.20200510/src/Makefile 
new/wireguard-tools-1.0.20200513/src/Makefile
--- old/wireguard-tools-1.0.20200510/src/Makefile       2020-05-11 
06:20:44.000000000 +0200
+++ new/wireguard-tools-1.0.20200513/src/Makefile       2020-05-14 
02:29:41.000000000 +0200
@@ -90,7 +90,7 @@
        @[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_BASHCOMPLETION)" = "yes" ] || 
exit 0; \
        install -v -m 0644 completion/wg-quick.bash-completion 
"$(DESTDIR)$(BASHCOMPDIR)/wg-quick"
        @[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_SYSTEMDUNITS)" = "yes" ] || 
exit 0; \
-       install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -v -m 0644 
systemd/wg-quick@.service "$(DESTDIR)$(SYSTEMDUNITDIR)/wg-quick@.service"
+       install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -v -m 0644 
systemd/* "$(DESTDIR)$(SYSTEMDUNITDIR)/"
 
 check: clean
        scan-build --html-title=wireguard-tools -maxloop 100 --view 
--keep-going $(MAKE) wg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireguard-tools-1.0.20200510/src/ipc.c 
new/wireguard-tools-1.0.20200513/src/ipc.c
--- old/wireguard-tools-1.0.20200510/src/ipc.c  2020-05-11 06:20:44.000000000 
+0200
+++ new/wireguard-tools-1.0.20200513/src/ipc.c  2020-05-14 02:29:41.000000000 
+0200
@@ -986,12 +986,12 @@
                        goto out;
                if (last_size >= wgdata.wgd_size)
                        break;
-               wgdata.wgd_mem = realloc(wgdata.wgd_mem, wgdata.wgd_size);
-               if (!wgdata.wgd_mem)
+               wgdata.wgd_interface = realloc(wgdata.wgd_interface, 
wgdata.wgd_size);
+               if (!wgdata.wgd_interface)
                        goto out;
        }
 
-       wg_iface = wgdata.wgd_mem;
+       wg_iface = wgdata.wgd_interface;
        dev = calloc(1, sizeof(*dev));
        if (!dev)
                goto out;
@@ -1017,7 +1017,8 @@
                dev->flags |= WGDEVICE_HAS_PRIVATE_KEY;
        }
 
-       for (wg_peer = wg_iface->i_peers; wg_peer; wg_peer = wg_peer->p_next) {
+       wg_peer = &wg_iface->i_peers[0];
+       for (size_t i = 0; i < wg_iface->i_peers_count; ++i) {
                peer = calloc(1, sizeof(*peer));
                if (!peer)
                        goto out;
@@ -1052,7 +1053,8 @@
                peer->last_handshake_time.tv_sec = 
wg_peer->p_last_handshake.tv_sec;
                peer->last_handshake_time.tv_nsec = 
wg_peer->p_last_handshake.tv_nsec;
 
-               for (wg_aip = wg_peer->p_aips; wg_aip; wg_aip = wg_aip->a_next) 
{
+               wg_aip = &wg_peer->p_aips[0];
+               for (size_t j = 0; j < wg_peer->p_aips_count; ++j) {
                        aip = calloc(1, sizeof(*aip));
                        if (!aip)
                                goto out;
@@ -1071,55 +1073,63 @@
                                memcpy(&aip->ip6, &wg_aip->a_ipv6, 
sizeof(aip->ip6));
                                aip->cidr = wg_aip->a_cidr;
                        }
+                       ++wg_aip;
                }
+               wg_peer = (struct wg_peer_io *)wg_aip;
        }
        *device = dev;
        errno = 0;
 out:
        ret = -errno;
-       free(wgdata.wgd_mem);
+       free(wgdata.wgd_interface);
        return ret;
 }
 
 static int kernel_set_device(struct wgdevice *dev)
 {
-       struct wg_data_io wgdata = { .wgd_size = 0 };
-       struct wg_interface_io wg_iface = { 0 };
-       struct wg_peer_io *wg_peer, *wg_peer_next;
-       struct wg_aip_io *wg_aip, *wg_aip_next;
+       struct wg_data_io wgdata = { .wgd_size = sizeof(struct wg_interface_io) 
};
+       struct wg_interface_io *wg_iface;
+       struct wg_peer_io *wg_peer;
+       struct wg_aip_io *wg_aip;
        struct wgpeer *peer;
        struct wgallowedip *aip;
        int s = get_dgram_socket(), ret;
+       size_t peer_count, aip_count;
 
        if (s < 0)
                return -errno;
 
+       for_each_wgpeer(dev, peer) {
+               wgdata.wgd_size += sizeof(struct wg_peer_io);
+               for_each_wgallowedip(peer, aip)
+                       wgdata.wgd_size += sizeof(struct wg_aip_io);
+       }
+       wg_iface = wgdata.wgd_interface = calloc(1, wgdata.wgd_size);
+       if (!wgdata.wgd_interface)
+               return -errno;
        strlcpy(wgdata.wgd_name, dev->name, sizeof(wgdata.wgd_name));
-       wgdata.wgd_mem = &wg_iface;
 
        if (dev->flags & WGDEVICE_HAS_PRIVATE_KEY) {
-               memcpy(wg_iface.i_private, dev->private_key, 
sizeof(wg_iface.i_private));
-               wg_iface.i_flags |= WG_INTERFACE_HAS_PRIVATE;
+               memcpy(wg_iface->i_private, dev->private_key, 
sizeof(wg_iface->i_private));
+               wg_iface->i_flags |= WG_INTERFACE_HAS_PRIVATE;
        }
 
        if (dev->flags & WGDEVICE_HAS_LISTEN_PORT) {
-               wg_iface.i_port = dev->listen_port;
-               wg_iface.i_flags |= WG_INTERFACE_HAS_PORT;
+               wg_iface->i_port = dev->listen_port;
+               wg_iface->i_flags |= WG_INTERFACE_HAS_PORT;
        }
 
        if (dev->flags & WGDEVICE_HAS_FWMARK) {
-               wg_iface.i_rtable = dev->fwmark;
-               wg_iface.i_flags |= WG_INTERFACE_HAS_RTABLE;
+               wg_iface->i_rtable = dev->fwmark;
+               wg_iface->i_flags |= WG_INTERFACE_HAS_RTABLE;
        }
 
        if (dev->flags & WGDEVICE_REPLACE_PEERS)
-               wg_iface.i_flags |= WG_INTERFACE_REPLACE_PEERS;
+               wg_iface->i_flags |= WG_INTERFACE_REPLACE_PEERS;
 
+       peer_count = 0;
+       wg_peer = &wg_iface->i_peers[0];
        for_each_wgpeer(dev, peer) {
-               wg_peer = calloc(1, sizeof(*wg_peer));
-               if (!wg_peer)
-                       goto out;
-
                wg_peer->p_flags = WG_PEER_HAS_PUBLIC;
                memcpy(wg_peer->p_public, peer->public_key, 
sizeof(wg_peer->p_public));
 
@@ -1145,14 +1155,9 @@
                if (peer->flags & WGPEER_REMOVE_ME)
                        wg_peer->p_flags |= WG_PEER_REMOVE;
 
-               wg_peer->p_next = wg_iface.i_peers;
-               wg_iface.i_peers = wg_peer;
-
+               aip_count = 0;
+               wg_aip = &wg_peer->p_aips[0];
                for_each_wgallowedip(peer, aip) {
-                       wg_aip = calloc(1, sizeof(*wg_aip));
-                       if (!wg_aip)
-                               goto out;
-
                        wg_aip->a_af = aip->family;
                        wg_aip->a_cidr = aip->cidr;
 
@@ -1161,14 +1166,16 @@
                        } else if (aip->family == AF_INET6) {
                                memcpy(&wg_aip->a_ipv6, &aip->ip6, 
sizeof(wg_aip->a_ipv6));
                        } else {
-                               free(wg_aip);
                                continue;
                        }
-
-                       wg_aip->a_next = wg_peer->p_aips;
-                       wg_peer->p_aips = wg_aip;
+                       ++aip_count;
+                       ++wg_aip;
                }
+               wg_peer->p_aips_count = aip_count;
+               ++peer_count;
+               wg_peer = (struct wg_peer_io *)wg_aip;
        }
+       wg_iface->i_peers_count = peer_count;
 
        if (ioctl(s, SIOCSWG, (caddr_t)&wgdata) < 0)
                goto out;
@@ -1176,14 +1183,7 @@
 
 out:
        ret = -errno;
-       for (wg_peer = wg_iface.i_peers; wg_peer; wg_peer = wg_peer_next) {
-               for (wg_aip = wg_peer->p_aips; wg_aip; wg_aip = wg_aip_next) {
-                       wg_aip_next = wg_aip->a_next;
-                       free(wg_aip);
-               }
-               wg_peer_next = wg_peer->p_next;
-               free(wg_peer);
-       }
+       free(wgdata.wgd_interface);
        return ret;
 }
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wireguard-tools-1.0.20200510/src/uapi/openbsd/net/if_wg.h 
new/wireguard-tools-1.0.20200513/src/uapi/openbsd/net/if_wg.h
--- old/wireguard-tools-1.0.20200510/src/uapi/openbsd/net/if_wg.h       
2020-05-11 06:20:44.000000000 +0200
+++ new/wireguard-tools-1.0.20200513/src/uapi/openbsd/net/if_wg.h       
2020-05-14 02:29:41.000000000 +0200
@@ -25,26 +25,16 @@
 #define SIOCSWG _IOWR('i', 210, struct wg_data_io)
 #define SIOCGWG _IOWR('i', 211, struct wg_data_io)
 
-struct wg_data_io {
-       char     wgd_name[IFNAMSIZ];
-       size_t   wgd_size;      /* size of the mem below */
-       void    *wgd_mem;       /* wg_interface_io{1},(wg_peer_io,wg_aip_io*)* 
*/
-};
-
-#define WG_INTERFACE_HAS_PUBLIC                (1 << 0)
-#define WG_INTERFACE_HAS_PRIVATE       (1 << 1)
-#define WG_INTERFACE_HAS_PORT          (1 << 2)
-#define WG_INTERFACE_HAS_RTABLE                (1 << 3)
-#define WG_INTERFACE_REPLACE_PEERS     (1 << 4)
-
-struct wg_interface_io {
-       uint8_t                  i_flags;
-       struct wg_peer_io       *i_peers;
+#define a_ipv4 a_addr.addr_ipv4
+#define a_ipv6 a_addr.addr_ipv6
 
-       in_port_t                i_port;
-       int                      i_rtable;
-       uint8_t                  i_public[WG_KEY_LEN];
-       uint8_t                  i_private[WG_KEY_LEN];
+struct wg_aip_io {
+       sa_family_t      a_af;
+       int              a_cidr;
+       union wg_aip_addr {
+               struct in_addr          addr_ipv4;
+               struct in6_addr         addr_ipv6;
+       }                a_addr;
 };
 
 #define WG_PEER_HAS_PUBLIC             (1 << 0)
@@ -60,42 +50,43 @@
 #define p_sin6         p_endpoint.sa_sin6
 
 struct wg_peer_io {
-       int                      p_flags;
-       struct wg_peer_io       *p_next;
-       struct wg_aip_io        *p_aips;
-
-       int                      p_protocol_version;
-       uint8_t                  p_public[WG_KEY_LEN];
-       uint8_t                  p_psk[WG_KEY_LEN];
-       uint16_t                 p_pka;
+       int                     p_flags;
+       int                     p_protocol_version;
+       uint8_t                 p_public[WG_KEY_LEN];
+       uint8_t                 p_psk[WG_KEY_LEN];
+       uint16_t                p_pka;
        union wg_peer_endpoint {
                struct sockaddr         sa_sa;
                struct sockaddr_in      sa_sin;
                struct sockaddr_in6     sa_sin6;
-       }                        p_endpoint;
-
-       uint64_t                 p_txbytes;
-       uint64_t                 p_rxbytes;
-       struct timespec          p_last_handshake; /* nanotime */
+       }                       p_endpoint;
+       uint64_t                p_txbytes;
+       uint64_t                p_rxbytes;
+       struct timespec         p_last_handshake; /* nanotime */
+       size_t                  p_aips_count;
+       struct wg_aip_io        p_aips[];
 };
 
-#define a_af   a_data.d_af
-#define a_cidr a_data.d_cidr
-#define a_addr a_data.d_addr
-#define a_ipv4 a_addr.addr_ipv4
-#define a_ipv6 a_addr.addr_ipv6
+#define WG_INTERFACE_HAS_PUBLIC                (1 << 0)
+#define WG_INTERFACE_HAS_PRIVATE       (1 << 1)
+#define WG_INTERFACE_HAS_PORT          (1 << 2)
+#define WG_INTERFACE_HAS_RTABLE                (1 << 3)
+#define WG_INTERFACE_REPLACE_PEERS     (1 << 4)
 
-struct wg_aip_io {
-       struct wg_aip_io        *a_next;
+struct wg_interface_io {
+       uint8_t                 i_flags;
+       in_port_t               i_port;
+       int                     i_rtable;
+       uint8_t                 i_public[WG_KEY_LEN];
+       uint8_t                 i_private[WG_KEY_LEN];
+       size_t                  i_peers_count;
+       struct wg_peer_io       i_peers[];
+};
 
-       struct wg_aip_data {
-               sa_family_t              d_af;
-               int                      d_cidr;
-               union wg_aip_addr {
-                       struct in_addr          addr_ipv4;
-                       struct in6_addr         addr_ipv6;
-               }                        d_addr;
-       }                        a_data;
+struct wg_data_io {
+       char                     wgd_name[IFNAMSIZ];
+       size_t                   wgd_size;      /* total size of the memory 
pointed to by wgd_interface */
+       struct wg_interface_io  *wgd_interface;
 };
 
 #endif /* __IF_WG_H__ */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wireguard-tools-1.0.20200510/src/version.h 
new/wireguard-tools-1.0.20200513/src/version.h
--- old/wireguard-tools-1.0.20200510/src/version.h      2020-05-11 
06:20:44.000000000 +0200
+++ new/wireguard-tools-1.0.20200513/src/version.h      2020-05-14 
02:29:41.000000000 +0200
@@ -1,3 +1,3 @@
 #ifndef WIREGUARD_TOOLS_VERSION
-#define WIREGUARD_TOOLS_VERSION "1.0.20200510"
+#define WIREGUARD_TOOLS_VERSION "1.0.20200513"
 #endif


Reply via email to