Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 617460 Details for
Bug 827115
support link-local ipv6 addresses
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Workaround for the spice-gtk bug
0001-Workaround-ipv6-scope-id-bug-in-gio.patch (text/plain), 5.32 KB, created by
Christophe Fergeau
on 2012-09-26 08:37:23 UTC
(
hide
)
Description:
Workaround for the spice-gtk bug
Filename:
MIME Type:
Creator:
Christophe Fergeau
Created:
2012-09-26 08:37:23 UTC
Size:
5.32 KB
patch
obsolete
>From be03b363648b57780deae09c220116d3ec02de51 Mon Sep 17 00:00:00 2001 >From: Christophe Fergeau <cfergeau@redhat.com> >Date: Tue, 25 Sep 2012 10:11:51 +0200 >Subject: [spice-gtk] Workaround ipv6 scope id bug in gio > >When using the GSocketEnumerator API with a GNetworkAddress >corresponding to an ipv6 address with a scope id (trailing '%if'), >the scope id is lost by gio, which then causes connection to fail. >This has been filed as bug https://bugzilla.gnome.org/show_bug.cgi?id=684404 >where a workaround was suggested (use the native socket API instead >of GIO and then call g_socket_address_new_from_native). >This patch implements that approach. It has been tested on Linux and >build-tested with mingw. >--- > configure.ac | 2 +- > gtk/spice-session.c | 59 ++++++++++++++++++++++++++++++++++++++++++----------- > 2 files changed, 48 insertions(+), 13 deletions(-) > >diff --git a/configure.ac b/configure.ac >index c7367cc..64a4271 100644 >--- a/configure.ac >+++ b/configure.ac >@@ -65,7 +65,7 @@ AC_MSG_RESULT([$os_win32]) > AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"]) > > AC_CHECK_HEADERS([sys/ipc.h sys/shm.h]) >-AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h]) >+AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h netdb.h ws2tcpip.h]) > > AC_CHECK_LIBM > AC_SUBST(LIBM) >diff --git a/gtk/spice-session.c b/gtk/spice-session.c >index 68d1594..37bae6b 100644 >--- a/gtk/spice-session.c >+++ b/gtk/spice-session.c >@@ -15,9 +15,24 @@ > You should have received a copy of the GNU Lesser General Public > License along with this library; if not, see <http://www.gnu.org/licenses/>. > */ >+#ifdef HAVE_CONFIG_H >+#include "config.h" >+#endif >+ > #include <gio/gio.h> > #include <glib.h> > >+#include <sys/types.h> >+#ifdef HAVE_SYS_SOCKET_H >+#include <sys/socket.h> >+#endif >+#ifdef HAVE_NETDB_H >+#include <netdb.h> >+#endif >+#ifdef HAVE_WS2TCPIP_H >+#include <ws2tcpip.h> >+#endif >+ > #include "common/ring.h" > > #include "spice-client.h" >@@ -1566,39 +1581,59 @@ GSocket* spice_session_channel_open_host(SpiceSession *session, SpiceChannel *ch > gboolean use_tls) > { > SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); >- GSocketConnectable *addr; >- GSocketAddressEnumerator *enumerator; >- GSocketAddress *sockaddr; > GError *conn_error = NULL; > GSocket *sock = NULL; >- int port; >+ const char *port; >+ struct addrinfo *ais = NULL; >+ struct addrinfo *ai = NULL; >+ gint retval; >+ struct addrinfo addrinfo_hints = { 0, }; > > if ((use_tls && !s->tls_port) || (!use_tls && !s->port)) > return NULL; > >- port = atoi(use_tls ? s->tls_port : s->port); >+ port = use_tls ? s->tls_port : s->port; > >- SPICE_DEBUG("Resolving host %s %d", s->host, port); >+ SPICE_DEBUG("Resolving host %s %s", s->host, port); > >- addr = g_network_address_new(s->host, port); >+#ifdef AI_ADDRCONFIG >+ addrinfo_hints.ai_flags |= AI_ADDRCONFIG; >+#endif >+ /* These two don't actually matter, they just get copied into the >+ * returned addrinfo structures (and then we ignore them). But if >+ * we leave them unset, we'll get back duplicate answers. >+ */ >+ addrinfo_hints.ai_socktype = SOCK_STREAM; >+ addrinfo_hints.ai_protocol = IPPROTO_TCP; > >- enumerator = g_socket_connectable_enumerate (addr); >- g_object_unref (addr); >+ retval = getaddrinfo (s->host, port, &addrinfo_hints, &ais); >+ if (retval != 0) >+ return NULL; > > /* Try each sockaddr until we succeed. Record the first > * connection error, but not any further ones (since they'll probably > * be basically the same as the first). > */ >- while (!sock && >- (sockaddr = g_socket_address_enumerator_next(enumerator, NULL, &conn_error))) { >+ for (ai = ais; ai; ai = ai->ai_next) { >+ GSocketAddress *sockaddr; >+ >+ sockaddr = g_socket_address_new_from_native (ai->ai_addr, ai->ai_addrlen); >+ if (!sockaddr || !G_IS_INET_SOCKET_ADDRESS (sockaddr)) >+ continue; >+ > SPICE_DEBUG("Trying one socket"); > g_clear_error(&conn_error); > sock = channel_connect_socket(channel, sockaddr, &conn_error); > if (conn_error != NULL) > SPICE_DEBUG("%s", conn_error->message); > g_object_unref(sockaddr); >+ if (sock != NULL) >+ break; > } >- g_object_unref(enumerator); >+ >+ if (ais) >+ freeaddrinfo(ais); >+ > g_clear_error(&conn_error); > return sock; > } >diff --git a/config.h.in b/config.h.in >index d924197..66ed6b2 100644 >--- a/config.h.in >+++ b/config.h.in >@@ -36,6 +36,9 @@ > /* Define to 1 if you have the <memory.h> header file. */ > #undef HAVE_MEMORY_H > >+/* Define to 1 if you have the <netdb.h> header file. */ >+#undef HAVE_NETDB_H >+ > /* Define to 1 if you have the <netinet/in.h> header file. */ > #undef HAVE_NETINET_IN_H > >@@ -88,6 +91,9 @@ > /* Have Win32? */ > #undef HAVE_WINDOWS > >+/* Define to 1 if you have the <ws2tcpip.h> header file. */ >+#undef HAVE_WS2TCPIP_H >+ > /* Have x11? */ > #undef HAVE_X11 > >diff --git a/configure b/configure >index c044392..116992d 100755 >--- a/configure >+++ b/configure >@@ -14828,7 +14828,7 @@ fi > > done > >-for ac_header in sys/socket.h netinet/in.h arpa/inet.h >+for ac_header in sys/socket.h netinet/in.h arpa/inet.h netdb.h ws2tcpip.h > do : > as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` > ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
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 827115
: 617460