vsftpd/vsftpd-2.2.2-v6only.patch

45 lines
1.6 KiB
Diff

diff -up vsftpd-2.2.2/standalone.c.v6only vsftpd-2.2.2/standalone.c
--- vsftpd-2.2.2/standalone.c.v6only 2010-05-14 16:09:38.181388723 +0200
+++ vsftpd-2.2.2/standalone.c 2010-05-14 16:09:38.207398800 +0200
@@ -77,6 +77,7 @@ vsf_standalone_main(void)
else
{
listen_sock = vsf_sysutil_get_ipv6_sock();
+ vsf_sysutil_v6only(listen_sock);
}
vsf_sysutil_activate_reuseaddr(listen_sock);
diff -up vsftpd-2.2.2/sysutil.c.v6only vsftpd-2.2.2/sysutil.c
--- vsftpd-2.2.2/sysutil.c.v6only 2010-05-17 09:09:59.848587511 +0200
+++ vsftpd-2.2.2/sysutil.c 2010-05-17 09:11:04.965806472 +0200
@@ -649,6 +649,18 @@ vsf_sysutil_wait_get_exitcode(const stru
status = ((struct vsf_sysutil_wait_retval*) p_waitret)->exit_status;
return WEXITSTATUS(status);
}
+
+void
+vsf_sysutil_v6only(int fd)
+{
+ int v6only = 1;
+ int retval = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &v6only,
+ sizeof(v6only));
+ if (retval != 0)
+ {
+ die("setsockopt: ipv6_v6only");
+ }
+}
void
vsf_sysutil_activate_keepalive(int fd)
diff -up vsftpd-2.2.2/sysutil.h.v6only vsftpd-2.2.2/sysutil.h
--- vsftpd-2.2.2/sysutil.h.v6only 2010-05-17 09:10:04.021567360 +0200
+++ vsftpd-2.2.2/sysutil.h 2010-05-17 09:11:24.343557618 +0200
@@ -264,6 +264,7 @@ int vsf_sysutil_connect_timeout(int fd,
void vsf_sysutil_dns_resolve(struct vsf_sysutil_sockaddr** p_sockptr,
const char* p_name);
/* Option setting on sockets */
+void vsf_sysutil_v6only(int fd);
void vsf_sysutil_activate_keepalive(int fd);
void vsf_sysutil_set_iptos_throughput(int fd);
void vsf_sysutil_activate_reuseaddr(int fd);