| 63 |
|
static PF comm_connect_tryconnect; |
| 64 |
|
|
| 65 |
|
|
| 66 |
– |
/* check_can_use_v6() |
| 67 |
– |
* Check if the system can open AF_INET6 sockets |
| 68 |
– |
*/ |
| 69 |
– |
void |
| 70 |
– |
check_can_use_v6(void) |
| 71 |
– |
{ |
| 72 |
– |
#ifdef IPV6 |
| 73 |
– |
int v6; |
| 74 |
– |
|
| 75 |
– |
if ((v6 = socket(AF_INET6, SOCK_STREAM, 0)) < 0) |
| 76 |
– |
ConfigServerInfo.can_use_v6 = 0; |
| 77 |
– |
else |
| 78 |
– |
{ |
| 79 |
– |
ConfigServerInfo.can_use_v6 = 1; |
| 80 |
– |
close(v6); |
| 81 |
– |
} |
| 82 |
– |
#else |
| 83 |
– |
ConfigServerInfo.can_use_v6 = 0; |
| 84 |
– |
#endif |
| 85 |
– |
} |
| 86 |
– |
|
| 66 |
|
/* get_sockerr - get the error value from the socket or the current errno |
| 67 |
|
* |
| 68 |
|
* Get the *real* error from the socket (well try to anyway..). |
| 721 |
|
if (newfd < 0) |
| 722 |
|
return -1; |
| 723 |
|
|
| 745 |
– |
#ifdef IPV6 |
| 724 |
|
remove_ipv6_mapping(addr); |
| 747 |
– |
#else |
| 748 |
– |
addr->ss_len = addrlen; |
| 749 |
– |
#endif |
| 725 |
|
|
| 726 |
|
setup_socket(newfd); |
| 727 |
|
|
| 735 |
|
* AF_INET and AF_INET6 map AF_INET connections inside AF_INET6 structures |
| 736 |
|
* |
| 737 |
|
*/ |
| 763 |
– |
#ifdef IPV6 |
| 738 |
|
void |
| 739 |
|
remove_ipv6_mapping(struct irc_ssaddr *addr) |
| 740 |
|
{ |
| 758 |
|
else |
| 759 |
|
addr->ss_len = sizeof(struct sockaddr_in); |
| 760 |
|
} |
| 787 |
– |
#endif |