Fix netif IPv6 handling, misc cleanup, license update from GPL-3 to BSL 1.1
This commit is contained in:
@@ -1,28 +1,15 @@
|
||||
/*
|
||||
* ZeroTier SDK - Network Virtualization Everywhere
|
||||
* Copyright (C) 2011-2019 ZeroTier, Inc. https://www.zerotier.com/
|
||||
* Copyright (c)2013-2020 ZeroTier, 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file in the project's root directory.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
* Change Date: 2024-01-01
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* You can be released from the requirements of the license by purchasing
|
||||
* a commercial license. Buying such a license is mandatory as soon as you
|
||||
* develop commercial closed-source software that incorporates or links
|
||||
* directly against ZeroTier software without disclosing the source code
|
||||
* of your own application.
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2.0 of the Apache License.
|
||||
*/
|
||||
/****/
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -96,8 +83,10 @@ VirtualTap::~VirtualTap()
|
||||
::write(_shutdownSignalPipe[1],"\0",1);
|
||||
#endif
|
||||
_phy.whack();
|
||||
lwip_remove_netif(netif);
|
||||
netif = NULL;
|
||||
lwip_remove_netif(netif4);
|
||||
netif4 = NULL;
|
||||
lwip_remove_netif(netif6);
|
||||
netif6 = NULL;
|
||||
Thread::join(_thread);
|
||||
#ifndef _WIN32
|
||||
::close(_shutdownSignalPipe[0]);
|
||||
@@ -144,7 +133,7 @@ bool VirtualTap::hasIpv6Addr()
|
||||
|
||||
bool VirtualTap::addIp(const InetAddress &ip)
|
||||
{
|
||||
//char ipbuf[128];
|
||||
char ipbuf[128];
|
||||
//ip.toString(ipbuf);
|
||||
//DEBUG_INFO("addr=%s", ipbuf);
|
||||
|
||||
@@ -152,9 +141,13 @@ bool VirtualTap::addIp(const InetAddress &ip)
|
||||
This limitation can be removed if some changes
|
||||
are made in the netif driver. */
|
||||
if (ip.isV4() && hasIpv4Addr()) {
|
||||
ip.toString(ipbuf);
|
||||
DEBUG_INFO("failed to add IP (%s), only one per type per netif allowed\n", ipbuf);
|
||||
return false;
|
||||
}
|
||||
if (ip.isV6() && hasIpv6Addr()) {
|
||||
ip.toString(ipbuf);
|
||||
DEBUG_INFO("failed to add IP (%s), only one per type per netif allowed\n", ipbuf);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user