forked from aniani/gmnisrv
Generalize IPV6_V6ONLY usage
Some platforms other than Linux may implement this socket option.
This commit is contained in:
parent
65c2a56c6d
commit
f88d817dca
@ -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"
|
||||||
}
|
}
|
||||||
|
@ -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));
|
||||||
|
Loading…
Reference in New Issue
Block a user