diff options
author | tijl <tijl@FreeBSD.org> | 2016-04-28 04:05:11 +0800 |
---|---|---|
committer | tijl <tijl@FreeBSD.org> | 2016-04-28 04:05:11 +0800 |
commit | ce78dbca77925768f154283e990d32fd958f07e8 (patch) | |
tree | 8ffb24ba616e009cb08a862d813f9f05f2e1c3df /net | |
parent | 74722c0f816af6957ce83497717c9d06d8e1d510 (diff) | |
download | freebsd-ports-gnome-ce78dbca77925768f154283e990d32fd958f07e8.tar.gz freebsd-ports-gnome-ce78dbca77925768f154283e990d32fd958f07e8.tar.zst freebsd-ports-gnome-ce78dbca77925768f154283e990d32fd958f07e8.zip |
Rather than listening on two sockets, one for IPv4 and one for IPv6 the
csync server listens on one IPv6 socket and uses IPv4 mapped IPv6 addresses
to support IPv4. This IPv6 feature is disabled by default on FreeBSD so
add a patch to enable it on the server socket.
PR: 208928
Tested by: ari@ish.com.au
Approved by: alexey@renatasystems.org (maintainer)
Diffstat (limited to 'net')
-rw-r--r-- | net/csync2/Makefile | 2 | ||||
-rw-r--r-- | net/csync2/files/patch-csync2.c | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/net/csync2/Makefile b/net/csync2/Makefile index a6d4386a73d6..f818a7c306d4 100644 --- a/net/csync2/Makefile +++ b/net/csync2/Makefile @@ -3,7 +3,7 @@ PORTNAME= csync2 PORTVERSION= 2.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= http://oss.linbit.com/csync2/ diff --git a/net/csync2/files/patch-csync2.c b/net/csync2/files/patch-csync2.c new file mode 100644 index 000000000000..82a700578f63 --- /dev/null +++ b/net/csync2/files/patch-csync2.c @@ -0,0 +1,21 @@ +--- csync2.c.orig 2013-05-02 12:58:04 UTC ++++ csync2.c +@@ -256,7 +256,7 @@ static int csync_server_bind(void) + struct addrinfo hints; + struct addrinfo *result, *rp; + int save_errno; +- int sfd = -1, s, on = 1; ++ int sfd = -1, s, off = 0, on = 1; + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_STREAM; +@@ -284,6 +284,9 @@ static int csync_server_bind(void) + goto error; + if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, (socklen_t) sizeof(on)) < 0) + goto error; ++ if (rp->ai_family == AF_INET6) ++ if (setsockopt(sfd, IPPROTO_IPV6, IPV6_V6ONLY, &off, (socklen_t) sizeof(off)) < 0) ++ goto error; + + if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == 0) + break; /* Success */ |