mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-14 21:28:17 +00:00
We don't bind to non-local IP for TCP yet, but eliminate double check.
This commit is contained in:
@ -1259,12 +1259,10 @@ public:
|
|||||||
|
|
||||||
inline void phyOnTcpAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN,const struct sockaddr *from)
|
inline void phyOnTcpAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN,const struct sockaddr *from)
|
||||||
{
|
{
|
||||||
if ((!from)||(reinterpret_cast<const InetAddress *>(from)->ipScope() != InetAddress::IP_SCOPE_LOOPBACK)) {
|
if (!from) {
|
||||||
// Non-Loopback: deny (for now)
|
|
||||||
_phy.close(sockN,false);
|
_phy.close(sockN,false);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Loopback == HTTP JSON API request
|
|
||||||
TcpConnection *tc = new TcpConnection();
|
TcpConnection *tc = new TcpConnection();
|
||||||
_tcpConnections.insert(tc);
|
_tcpConnections.insert(tc);
|
||||||
tc->type = TcpConnection::TCP_HTTP_INCOMING;
|
tc->type = TcpConnection::TCP_HTTP_INCOMING;
|
||||||
|
Reference in New Issue
Block a user