1
0
forked from aniani/gmnisrv

Generalize IPV6_V6ONLY usage

Some platforms other than Linux may implement this socket option.
This commit is contained in:
Drew DeVault 2020-09-23 12:44:42 -04:00
parent 65c2a56c6d
commit f88d817dca
2 changed files with 1 additions and 7 deletions

View File

@ -30,12 +30,6 @@ do
esac
done
case "$(uname)" in
Linux)
CFLAGS="$CFLAGS -DLINUX"
;;
esac
subdir() {
eval ". $srcdir/$1/configure"
}

View File

@ -50,7 +50,7 @@ server_init(struct gmnisrv_server *server, struct gmnisrv_config *conf)
in.sin6_port = htons(b->port);
addr = (struct sockaddr *)∈
addrsz = sizeof(in);
#ifdef LINUX
#ifdef IPV6_V6ONLY
static int t = 1;
setsockopt(sockfd, IPPROTO_IPV6,
IPV6_V6ONLY, &t, sizeof(t));