1
0
mirror of https://git.sr.ht/~sircmpwn/gmnisrv synced 2024-12-04 14:46:42 -05:00

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 esac
done done
case "$(uname)" in
Linux)
CFLAGS="$CFLAGS -DLINUX"
;;
esac
subdir() { subdir() {
eval ". $srcdir/$1/configure" 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); in.sin6_port = htons(b->port);
addr = (struct sockaddr *)∈ addr = (struct sockaddr *)∈
addrsz = sizeof(in); addrsz = sizeof(in);
#ifdef LINUX #ifdef IPV6_V6ONLY
static int t = 1; static int t = 1;
setsockopt(sockfd, IPPROTO_IPV6, setsockopt(sockfd, IPPROTO_IPV6,
IPV6_V6ONLY, &t, sizeof(t)); IPV6_V6ONLY, &t, sizeof(t));