Skip to content
Permalink
Browse files

ifdef ipv6 variable

  • Loading branch information...
vanosg committed Oct 27, 2019
2 parents 105d351 + a2b874f commit 32959d3b7cedfd067e74355595c3d30cb771c694
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/net.c
@@ -130,14 +130,14 @@ char *iptostr(struct sockaddr *sa)
*/
int setsockname(sockname_t *addr, char *src, int port, int allowres)
{
char *src2 = src;
char *endptr;
long val;
IP ip;
struct hostent *hp;
int af = AF_UNSPEC;
#ifdef IPV6
char ip2[INET6_ADDRSTRLEN];
char *src2 = src;
int pref;
#else
char ip2[INET_ADDRSTRLEN];
@@ -151,7 +151,9 @@ int setsockname(sockname_t *addr, char *src, int port, int allowres)
ip = htonl(val);
if (inet_ntop(AF_INET, &ip, ip2, sizeof ip2)) {
debug2("net: setsockname(): ip %s -> %s", src, ip2);
#ifdef IPV6
src2 = ip2;
#endif
}
}
#ifdef IPV6

0 comments on commit 32959d3

Please sign in to comment.
You can’t perform that action at this time.