Bugzilla – Attachment 1720 Details for
Bug 1648
Fix IPV6_V6ONLY for -L with -g
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
unify setsockopt(...,IPV6_V6ONLY,...) calls
ssh-v6only.diff (text/plain), 2.89 KB, created by
Damien Miller
on 2009-11-10 14:13:52 AEDT
(
hide
)
Description:
unify setsockopt(...,IPV6_V6ONLY,...) calls
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2009-11-10 14:13:52 AEDT
Size:
2.89 KB
patch
obsolete
>Index: channels.c >=================================================================== >RCS file: /var/cvs/openssh/channels.c,v >retrieving revision 1.285 >diff -u -p -r1.285 channels.c >--- channels.c 28 Aug 2009 01:02:37 -0000 1.285 >+++ channels.c 10 Nov 2009 03:12:05 -0000 >@@ -2577,6 +2577,8 @@ channel_setup_fwd_listener(int type, con > } > > channel_set_reuseaddr(sock); >+ if (ai->ai_family == AF_INET6) >+ sock_set_v6only(sock); > > debug("Local forwarding listening on %s port %s.", > ntop, strport); >@@ -3108,13 +3110,8 @@ x11_create_display_inet(int x11_display_ > continue; > } > } >-#ifdef IPV6_V6ONLY >- if (ai->ai_family == AF_INET6) { >- int on = 1; >- if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) >- error("setsockopt IPV6_V6ONLY: %.100s", strerror(errno)); >- } >-#endif >+ if (ai->ai_family == AF_INET6) >+ sock_set_v6only(sock); > if (x11_use_localhost) > channel_set_reuseaddr(sock); > if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { >Index: misc.c >=================================================================== >RCS file: /var/cvs/openssh/misc.c,v >retrieving revision 1.89 >diff -u -p -r1.89 misc.c >--- misc.c 21 Feb 2009 21:47:02 -0000 1.89 >+++ misc.c 10 Nov 2009 03:12:05 -0000 >@@ -849,3 +849,14 @@ ms_to_timeval(struct timeval *tv, int ms > tv->tv_usec = (ms % 1000) * 1000; > } > >+void >+sock_set_v6only(int s) >+{ >+#ifdef IPV6_V6ONLY >+ int on = 1; >+ >+ debug3("%s: set socket %d IPV6_V6ONLY", __func__, s); >+ if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) == -1) >+ error("setsockopt IPV6_V6ONLY: %s", strerror(errno)); >+#endif >+} >Index: misc.h >=================================================================== >RCS file: /var/cvs/openssh/misc.h,v >retrieving revision 1.41 >diff -u -p -r1.41 misc.h >--- misc.h 12 Jun 2008 20:42:45 -0000 1.41 >+++ misc.h 10 Nov 2009 03:12:05 -0000 >@@ -35,6 +35,7 @@ char *tohex(const void *, size_t); > void sanitise_stdfd(void); > void ms_subtract_diff(struct timeval *, int *); > void ms_to_timeval(struct timeval *, int); >+void sock_set_v6only(int); > > struct passwd *pwcopy(struct passwd *); > const char *ssh_gai_strerror(int); >Index: sshd.c >=================================================================== >RCS file: /var/cvs/openssh/sshd.c,v >retrieving revision 1.386 >diff -u -p -r1.386 sshd.c >--- sshd.c 21 Jun 2009 10:26:17 -0000 1.386 >+++ sshd.c 10 Nov 2009 03:12:05 -0000 >@@ -979,15 +979,9 @@ server_listen(void) > &on, sizeof(on)) == -1) > error("setsockopt SO_REUSEADDR: %s", strerror(errno)); > >-#ifdef IPV6_V6ONLY > /* Only communicate in IPv6 over AF_INET6 sockets. */ >- if (ai->ai_family == AF_INET6) { >- if (setsockopt(listen_sock, IPPROTO_IPV6, IPV6_V6ONLY, >- &on, sizeof(on)) == -1) >- error("setsockopt IPV6_V6ONLY: %s", >- strerror(errno)); >- } >-#endif >+ if (ai->ai_family == AF_INET6) >+ sock_set_v6only(listen_sock); > > debug("Bind to port %s on %s.", strport, ntop); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1648
:
1695
| 1720