diff --git a/osdep/LinuxEthernetTap.cpp b/osdep/LinuxEthernetTap.cpp index 275443bd4..4abc54b92 100644 --- a/osdep/LinuxEthernetTap.cpp +++ b/osdep/LinuxEthernetTap.cpp @@ -48,6 +48,10 @@ #include #include +#ifndef IFNAMSIZ +#define IFNAMSIZ 16 +#endif + // ff:ff:ff:ff:ff:ff with no ADI static const ZeroTier::MulticastGroup _blindWildcardMulticastGroup(ZeroTier::MAC(0xff),0); diff --git a/osdep/LinuxNetLink.cpp b/osdep/LinuxNetLink.cpp index 8ee477278..421da1f63 100644 --- a/osdep/LinuxNetLink.cpp +++ b/osdep/LinuxNetLink.cpp @@ -22,6 +22,10 @@ #include #include +#ifndef IFNAMSIZ +#define IFNAMSIZ 16 +#endif + namespace ZeroTier { struct nl_route_req { diff --git a/osdep/LinuxNetLink.hpp b/osdep/LinuxNetLink.hpp index c5e08c232..22222e468 100644 --- a/osdep/LinuxNetLink.hpp +++ b/osdep/LinuxNetLink.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +//#include #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; diff --git a/osdep/ManagedRoute.cpp b/osdep/ManagedRoute.cpp index a91f9f6da..85f2c67c9 100644 --- a/osdep/ManagedRoute.cpp +++ b/osdep/ManagedRoute.cpp @@ -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__ ----------------------------------------------------------