diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-10-13 09:37:17 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-10-13 09:37:17 -0700 |
| commit | 05309037a86688fb55ebd4a9667f7c32cd5f975c (patch) | |
| tree | 142e4fe7990b2453e7f78fe455ca699817382267 /node/UdpSocket.cpp | |
| parent | 7943414c89c627a91a45e58d309d03b91ab75f87 (diff) | |
| download | infinitytier-05309037a86688fb55ebd4a9667f7c32cd5f975c.tar.gz infinitytier-05309037a86688fb55ebd4a9667f7c32cd5f975c.zip | |
Yank potentially costly support for TTL out of UdpSocket since we dont use this anymore.
Diffstat (limited to 'node/UdpSocket.cpp')
| -rw-r--r-- | node/UdpSocket.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/node/UdpSocket.cpp b/node/UdpSocket.cpp index 60884a53..1f699027 100644 --- a/node/UdpSocket.cpp +++ b/node/UdpSocket.cpp @@ -65,32 +65,19 @@ UdpSocket::~UdpSocket() bool UdpSocket::send(const InetAddress &to,const void *msg,unsigned int msglen) { - return sendWithHopLimit(to,msg,msglen,0); -} - -bool UdpSocket::sendWithHopLimit(const InetAddress &to,const void *msg,unsigned int msglen,int hopLimit) -{ #ifdef ZT_BREAK_UDP return true; #else - if (hopLimit <= 0) - hopLimit = 255; if (to.isV6()) { #ifdef __WINDOWS__ - DWORD hltmp = (DWORD)hopLimit; - setsockopt(_sock,IPPROTO_IPV6,IPV6_UNICAST_HOPS,(const char *)&hltmp,sizeof(hltmp)); return ((int)sendto(_sock,(const char *)msg,msglen,0,to.saddr(),to.saddrLen()) == (int)msglen); #else - setsockopt(_sock,IPPROTO_IPV6,IPV6_UNICAST_HOPS,&hopLimit,sizeof(hopLimit)); return ((int)sendto(_sock,msg,msglen,0,to.saddr(),to.saddrLen()) == (int)msglen); #endif } else { #ifdef __WINDOWS__ - DWORD hltmp = (DWORD)hopLimit; - setsockopt(_sock,IPPROTO_IP,IP_TTL,(const char *)&hltmp,sizeof(hltmp)); return ((int)sendto(_sock,(const char *)msg,msglen,0,to.saddr(),to.saddrLen()) == (int)msglen); #else - setsockopt(_sock,IPPROTO_IP,IP_TTL,&hopLimit,sizeof(hopLimit)); return ((int)sendto(_sock,msg,msglen,0,to.saddr(),to.saddrLen()) == (int)msglen); #endif } |
