This commit is contained in:
Joseph Henry 2020-11-16 12:04:03 -08:00
commit ae70db0535
4 changed files with 10 additions and 26 deletions

View File

@ -48,6 +48,10 @@
#include <utility>
#include <string>
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#endif
// ff:ff:ff:ff:ff:ff with no ADI
static const ZeroTier::MulticastGroup _blindWildcardMulticastGroup(ZeroTier::MAC(0xff),0);

View File

@ -22,6 +22,10 @@
#include <unistd.h>
#include <linux/if_tun.h>
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#endif
namespace ZeroTier {
struct nl_route_req {

View File

@ -26,7 +26,7 @@
#include <asm/types.h>
#include <linux/rtnetlink.h>
#include <sys/socket.h>
#include <linux/if.h>
//#include <linux/if.h>
#include "../node/InetAddress.hpp"
#include "../node/MAC.hpp"
@ -132,7 +132,7 @@ private:
iface_entry()
{ memset(this,0,sizeof(iface_entry)); }
int index;
char ifacename[IFNAMSIZ];
char ifacename[16]; // IFNAMSIZ on Linux == 16
char mac[18];
char mac_bin[6];
unsigned int mtu;

View File

@ -54,8 +54,6 @@
#endif
#define ZT_BSD_ROUTE_CMD "/sbin/route"
#define ZT_LINUX_IP_COMMAND "/sbin/ip"
#define ZT_LINUX_IP_COMMAND_2 "/usr/sbin/ip"
namespace ZeroTier {
@ -273,28 +271,6 @@ static void _routeCmd(const char *op,const InetAddress &target,const InetAddress
#define ZT_ROUTING_SUPPORT_FOUND 1
// This has been replaced by LinuxNetLink
/*
static void _routeCmd(const char *op,const InetAddress &target,const InetAddress &via,const char *localInterface)
{
long p = (long)fork();
if (p > 0) {
int exitcode = -1;
::waitpid(p,&exitcode,0);
} else if (p == 0) {
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
char ipbuf[64],ipbuf2[64];
if (via) {
::execl(ZT_LINUX_IP_COMMAND,ZT_LINUX_IP_COMMAND,(target.ss_family == AF_INET6) ? "-6" : "-4","route",op,target.toString(ipbuf),"via",via.toIpString(ipbuf2),(const char *)0);
::execl(ZT_LINUX_IP_COMMAND_2,ZT_LINUX_IP_COMMAND_2,(target.ss_family == AF_INET6) ? "-6" : "-4","route",op,target.toString(ipbuf),"via",via.toIpString(ipbuf2),(const char *)0);
} else if ((localInterface)&&(localInterface[0])) {
::execl(ZT_LINUX_IP_COMMAND,ZT_LINUX_IP_COMMAND,(target.ss_family == AF_INET6) ? "-6" : "-4","route",op,target.toString(ipbuf),"dev",localInterface,(const char *)0);
::execl(ZT_LINUX_IP_COMMAND_2,ZT_LINUX_IP_COMMAND_2,(target.ss_family == AF_INET6) ? "-6" : "-4","route",op,target.toString(ipbuf),"dev",localInterface,(const char *)0);
}
::_exit(-1);
}
}
*/
#endif // __LINUX__ ----------------------------------------------------------