Wtz_LASR
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
0 deletions
-
src/wire.c
|
@ -673,7 +673,11 @@ int fill_sockaddr (struct sockaddr * addr, |
|
|
// fills struct sockaddr's data into n2n_sock
|
|
|
// fills struct sockaddr's data into n2n_sock
|
|
|
int fill_n2nsock (n2n_sock_t* sock, const struct sockaddr* sa) { |
|
|
int fill_n2nsock (n2n_sock_t* sock, const struct sockaddr* sa) { |
|
|
|
|
|
|
|
|
|
|
|
#ifdef __APPLE__ |
|
|
|
|
|
sock->family = sa->sa_family; |
|
|
|
|
|
#else |
|
|
sock->family = *(sa_family_t*)sa; |
|
|
sock->family = *(sa_family_t*)sa; |
|
|
|
|
|
#endif |
|
|
switch(sock->family) { |
|
|
switch(sock->family) { |
|
|
case AF_INET: { |
|
|
case AF_INET: { |
|
|
sock->port = ntohs(((struct sockaddr_in*)sa)->sin_port); |
|
|
sock->port = ntohs(((struct sockaddr_in*)sa)->sin_port); |
|
|