From 2f191e0fd08a0b6f44eed046599e177470cff358 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 7 Mar 2007 13:47:58 +0000 Subject: [PATCH] - Handle ipv6 link-local addresses better in network:/// (#212565) --- gnome-vfs-2.16.2-ipv6-link-local.patch | 72 ++++++++++++++++++++++++++ gnome-vfs2.spec | 11 +++- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 gnome-vfs-2.16.2-ipv6-link-local.patch diff --git a/gnome-vfs-2.16.2-ipv6-link-local.patch b/gnome-vfs-2.16.2-ipv6-link-local.patch new file mode 100644 index 0000000..5a23513 --- /dev/null +++ b/gnome-vfs-2.16.2-ipv6-link-local.patch @@ -0,0 +1,72 @@ +--- gnome-vfs-2.16.2/libgnomevfs/gnome-vfs-dns-sd.c.ipv6 2006-11-30 13:40:48.000000000 +0100 ++++ gnome-vfs-2.16.2/libgnomevfs/gnome-vfs-dns-sd.c 2006-11-30 14:28:48.000000000 +0100 +@@ -1959,6 +1959,7 @@ + struct sync_resolve_data { + AvahiSimplePoll *poll; + gboolean got_data; ++ gboolean got_link_local_ipv6; + char *host; + int port; + char *text; +@@ -1997,6 +1998,13 @@ + + data = user_data; + if (event == AVAHI_RESOLVER_FOUND) { ++ if (address->proto == AVAHI_PROTO_INET6 && ++ address->data.ipv6.address[0] == 0xfe && ++ address->data.ipv6.address[1] == 0x80) { ++ data->got_link_local_ipv6 = TRUE; ++ goto out; ++ } ++ + data->got_data = TRUE; + avahi_address_snprint (a, sizeof(a), address); + data->host = g_strdup (a); +@@ -2005,7 +2013,7 @@ + data->text = g_malloc (data->text_len); + avahi_string_list_serialize (txt, data->text, data->text_len); + } +- ++ out: + avahi_service_resolver_free (r); + avahi_simple_poll_quit (data->poll); + } +@@ -2090,8 +2098,13 @@ + AvahiClient *client = NULL; + AvahiServiceResolver *sr; + int error; ++ AvahiProtocol protocol; + struct sync_resolve_data resolve_data = {0}; + ++ protocol = AVAHI_PROTO_UNSPEC; ++ ++ retry: ++ + simple_poll = avahi_simple_poll_new (); + resolve_data.poll = simple_poll; + if (simple_poll == NULL) { +@@ -2109,7 +2122,8 @@ + return GNOME_VFS_ERROR_GENERIC; + } + +- sr = avahi_service_resolver_new (client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, ++ resolve_data.got_link_local_ipv6 = FALSE; ++ sr = avahi_service_resolver_new (client, AVAHI_IF_UNSPEC, protocol, + name, type, domain, AVAHI_PROTO_UNSPEC, + 0, avahi_resolve_sync_callback, &resolve_data); + if (sr == NULL) { +@@ -2127,6 +2141,14 @@ + avahi_client_free (client); + avahi_simple_poll_free (simple_poll); + ++ ++ if (resolve_data.got_link_local_ipv6) { ++ /* We ignore non-routable ipv6 link-local addresses here, because our ++ api doesn't give the iface, so they are useless. Prefer ipv4 address instead */ ++ protocol = AVAHI_PROTO_INET; ++ goto retry; ++ } ++ + if (resolve_data.got_data) { + *host = resolve_data.host; + *port = resolve_data.port; diff --git a/gnome-vfs2.spec b/gnome-vfs2.spec index 0da63b6..464f463 100644 --- a/gnome-vfs2.spec +++ b/gnome-vfs2.spec @@ -14,7 +14,7 @@ Summary: The GNOME virtual file-system libraries Name: gnome-vfs2 Version: 2.17.91 -Release: 1%{?dist} +Release: 2%{?dist} License: LGPL Group: System Environment/Libraries Source0: http://ftp.gnome.org/pub/gnome/source/gnome-vfs/2.17/gnome-vfs-%{version}.tar.bz2 @@ -69,6 +69,10 @@ Patch6: gnome-vfs-2.15.91-mailto-command.patch # http://bugzilla.gnome.org/show_bug.cgi?id=356772 Patch8: gnome-vfs-2.16.0-no-dbus.patch +# We broke network: on link-local ipv6 addresses (#212565) +Patch9: gnome-vfs-2.16.2-ipv6-link-local.patch + + %description GNOME VFS is the GNOME virtual file system. It is the foundation of the Nautilus file manager. It provides a modular architecture and @@ -121,6 +125,8 @@ shares (SMB) to applications using GNOME VFS. %patch8 -p1 -b .no-dbus +%patch9 -p1 -b .ipv6 + %build if pkg-config openssl ; then @@ -223,6 +229,9 @@ fi %config %{_sysconfdir}/gnome-vfs-2.0/modules/smb-module.conf %changelog +* Wed Mar 7 2007 Alexander Larsson - 2.17.91-2 +- Handle ipv6 link-local addresses better in network:/// (#212565) + * Mon Feb 12 2007 Matthias Clasen - 2.17.91-1 - Update to 2.17.91