Browse Source

zerotier: fix compilation with GCC10

Patch taken from upstream.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
lilik-openwrt-22.03
Rosen Penev 4 years ago
parent
commit
cd3a4f4731
No known key found for this signature in database GPG Key ID: 36D31CFA845F0E3B
2 changed files with 40 additions and 1 deletions
  1. +1
    -1
      net/zerotier/Makefile
  2. +39
    -0
      net/zerotier/patches/030-gcc10.patch

+ 1
- 1
net/zerotier/Makefile View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=zerotier
PKG_VERSION:=1.4.6
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?


+ 39
- 0
net/zerotier/patches/030-gcc10.patch View File

@ -0,0 +1,39 @@
From cce4fa719d447c55d93458b25fa92717a2d61a60 Mon Sep 17 00:00:00 2001
From: Jonas Witschel <diabonas@archlinux.org>
Date: Tue, 14 Jul 2020 14:20:16 +0200
Subject: [PATCH] Fix compilation with GCC 10 by providing explicit cast of
_bindingCount
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Compilation with GCC 10 fails with the following error:
service/../osdep/Binder.hpp: In member function ‘void ZeroTier::Binder::refresh(ZeroTier::Phy<PHY_HANDLER_TYPE>&, unsigned int*, unsigned int, std::vector<ZeroTier::InetAddress>, INTERFACE_CHECKER&)’:
service/../osdep/Binder.hpp:376:30: internal compiler error: unexpected expression ‘(std::__atomic_base<unsigned int>::__int_type)((ZeroTier::Binder*)this)->ZeroTier::Binder::_bindingCount’ of kind implicit_conv_expr
376 | _bindings[_bindingCount].udpSock = udps;
| ^
Help the compiler by providing an explicit cast to the appropriate type like it
is already done in l. 338 of the same file.
---
osdep/Binder.hpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/osdep/Binder.hpp b/osdep/Binder.hpp
index 660e6f0c..a5bc85c9 100644
--- a/osdep/Binder.hpp
+++ b/osdep/Binder.hpp
@@ -373,9 +373,9 @@ class Binder
}
#endif // __LINUX__
if (_bindingCount < ZT_BINDER_MAX_BINDINGS) {
- _bindings[_bindingCount].udpSock = udps;
- _bindings[_bindingCount].tcpListenSock = tcps;
- _bindings[_bindingCount].address = ii->first;
+ _bindings[(unsigned int)_bindingCount].udpSock = udps;
+ _bindings[(unsigned int)_bindingCount].tcpListenSock = tcps;
+ _bindings[(unsigned int)_bindingCount].address = ii->first;
phy.setIfName(udps,(char*)ii->second.c_str(),(int)ii->second.length());
++_bindingCount;
}

Loading…
Cancel
Save