mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
parent
4655a59912
commit
7a63fdc447
2 changed files with 4 additions and 2 deletions
|
@ -127,8 +127,10 @@ void InetAddress::set(const void *ipBytes,unsigned int ipLen,unsigned int port)
|
||||||
{
|
{
|
||||||
memset(this,0,sizeof(InetAddress));
|
memset(this,0,sizeof(InetAddress));
|
||||||
if (ipLen == 4) {
|
if (ipLen == 4) {
|
||||||
|
uint32_t ipb[1];
|
||||||
|
memcpy(ipb,ipBytes,4);
|
||||||
ss_family = AF_INET;
|
ss_family = AF_INET;
|
||||||
reinterpret_cast<struct sockaddr_in *>(this)->sin_addr.s_addr = *(reinterpret_cast<const uint32_t *>(ipBytes));
|
reinterpret_cast<struct sockaddr_in *>(this)->sin_addr.s_addr = ipb[0];
|
||||||
reinterpret_cast<struct sockaddr_in *>(this)->sin_port = Utils::hton((uint16_t)port);
|
reinterpret_cast<struct sockaddr_in *>(this)->sin_port = Utils::hton((uint16_t)port);
|
||||||
} else if (ipLen == 16) {
|
} else if (ipLen == 16) {
|
||||||
ss_family = AF_INET6;
|
ss_family = AF_INET6;
|
||||||
|
|
|
@ -852,7 +852,7 @@ struct TestPhyHandlers
|
||||||
inline void phyOnUnixAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN) {}
|
inline void phyOnUnixAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN) {}
|
||||||
inline void phyOnUnixClose(PhySocket *sock,void **uptr) {}
|
inline void phyOnUnixClose(PhySocket *sock,void **uptr) {}
|
||||||
inline void phyOnUnixData(PhySocket *sock,void **uptr,void *data,unsigned long len) {}
|
inline void phyOnUnixData(PhySocket *sock,void **uptr,void *data,unsigned long len) {}
|
||||||
inline void phyOnUnixWritable(PhySocket *sock,void **uptr) {}
|
inline void phyOnUnixWritable(PhySocket *sock,void **uptr,bool b) {}
|
||||||
#endif // __UNIX_LIKE__
|
#endif // __UNIX_LIKE__
|
||||||
|
|
||||||
inline void phyOnFileDescriptorActivity(PhySocket *sock,void **uptr,bool readable,bool writable) {}
|
inline void phyOnFileDescriptorActivity(PhySocket *sock,void **uptr,bool readable,bool writable) {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue