~ubuntu-branches/ubuntu/hardy/glibc/hardy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/any/submitted-link-local_resolver.diff

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose, changes from Debian svn after -9
  • Date: 2008-03-12 22:08:00 UTC
  • Revision ID: james.westby@ubuntu.com-20080312220800-coa87np9p6myi9dl
Tags: 2.7-9ubuntu1
* Merge with Debian (r2869); remaining changes:
  - Packaging:
    + External tzdata
    + Use external locale information
    + Addition of Niagara and Niagara2 optimised libraries
    + GFDL Documentation added back in, build glibc-doc from this source.
    + Transition from /usr/include/ppc64-linux-gnu to powerpc64-linux-gnu
    + Use dpkg triggers for ldconfig
    + Do not die if extra libc libraries or symlinks found
    + Do not do a test run of nscd when starting
    + Only apply patches we actually use in Ubuntu
    + Use /lib and /usr/lib for amd64
    + amd64 biarch is i686, not i486.
    + Non-optimised i386 glibc is Xen-friendly.
    + Support sparcv9v, v9v2, 64b, 64v, 64v2
    + Add support for lpia.
  - Patches:
    + sparc/submitted-v9v2
    + hppa/hppalll
    + Applied any/local-ipv6-lookup.
    + Not applied any/local-sysctl.
* debian/sysdeps/*.mk: Still build main flavours with -O3 (using gcc-4.2).
* Use <triplet>.conf for files in /etc/ld.so.conf.d. LP: #70315

* patches/any/local-ipv6-lookup.diff: Update (Tollef van Heen).

[changes from Debian svn after -9]
* Update Chinese debconf translation, by LI Daobing.
* Update Dutch debconf translation, by Bart Cornelis.  Closes: #468300.
* Update Polish debcon translation, by Emilian Nowak.
* Update Vietnamese debconf translation, by Clytie Siddall.  Closes: #468453.
* Update Basque debconf translation, by Piarres Beobide.  Closes: #468463.
* Update Romanian debconf translation, by Stan Ioan-Eugen.  Closes: #468671.
* Update Czech debconf translation, by Miroslav Kure.  Closes: #468910.
* Update Russian debconf translation, by Sergey Alyoshin.  Closes: #469037.
* Update Korean debconf translation, by Sunjae Park.  Closes: #469097.
* Update French debconf translation, by Christian Perrier.  Closes: #469249.
* patches/localedata/locale-es_CR.diff: chane AM/PM format to "a.m./p.m." 
  from "A.M/P.M.".
* Remove uk_UA from patches/localedata/first_weekday.diff: merged upstream
  in a different way.  Closes: bug#469439.
* patches/any/cvs-rfc3484.diff: update from CVS to allow the definition of
  IPv4 scopes in /etc/gai.conf.    
* patches/all/cvs-gai_conf.diff: update gai.conf from CVS to also mention
  Teredo tunnels and scopev4 defaults.
* sysdeps/mips.mk, sysdeps/mipsel.mk: define TIMEOUTFACTOR.
* patches/any/cvs-strtod.diff: new patch from CVS to fix strtod().  Closes:
  #465769.
* Update Italian debconf translation, by Lica Monducci.  Closes: #469985.
* control.in/main, sysdeps/*.mk, rules: build with gcc-4.3 by default,
  except on alpha, arm, armel, hppa, s390 and hurd-i386.
* rules, rules.d/build.mk: fix parallel build.
* control.in/main: build-depends on gcc-4.3 (>= 4.3.0-2) to make sure a cld
  instruction is emitted in the prologue of functions using stringops.
  Closes: #469568.
* debian/rules.d/build.mk: disable testsuite on ARM machines running a
  2.6.21 to 2.6.24 kernel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
It seems that glibc's resolver does not support IPv6 link-local
 
2
addresses with an explicit scope (like fe80::[...]%eth0), in the
 
3
nameserver options in /etc/resolv.conf. Currently, nameservers with a
 
4
scope fail to be parsed. Nameservers with a link-local address (without
 
5
scope) are parsed and used, but obviously do not work (connect() fails
 
6
with EINVAL because a sin6_scope_id of 0 is used with the link-local
 
7
address).
 
8
 
 
9
With the apparition of the new RDNSS option (RFC5006), which allows
 
10
for DNS configuration through stateless autoconf, we expect that IPv6
 
11
link-local resolvers may be used, and set into /etc/resolv.conf.
 
12
Kernel-side support is included in Linux 2.6.24, and the corresponding
 
13
userland RDNSS daemon is currently under development and will be shipped
 
14
in the next release of the ndisc6 package. We would need glibc to
 
15
support this feature to integrate our work.
 
16
 
 
17
Please review this patch, and consider it for application and submission
 
18
to upstream.
 
19
 
 
20
--- resolv/res_init.c   2007-12-09 17:30:57.000000000 +0100
 
21
+++ resolv/res_init.c   2007-12-09 18:19:40.000000000 +0100
 
22
@@ -74,11 +74,14 @@ static const char rcsid[] = "$BINDId: re
 
23
 #include <sys/socket.h>
 
24
 #include <sys/time.h>
 
25
 
 
26
+#include <net/if.h>
 
27
 #include <netinet/in.h>
 
28
 #include <arpa/inet.h>
 
29
 #include <arpa/nameser.h>
 
30
 
 
31
+#include <assert.h>
 
32
 #include <ctype.h>
 
33
+#include <netdb.h>
 
34
 #include <resolv.h>
 
35
 #include <stdio.h>
 
36
 #include <stdio_ext.h>
 
37
@@ -327,6 +330,8 @@ __res_vinit(res_state statp, int preinit
 
38
 
 
39
                         if ((el = strchr(cp, '\n')) != NULL)
 
40
                             *el = '\0';
 
41
+                        if ((el = strchr(cp, SCOPE_DELIMITER)) != NULL)
 
42
+                            *el = '\0';
 
43
                         if ((*cp != '\0') &&
 
44
                             (inet_pton(AF_INET6, cp, &a6) > 0)) {
 
45
                             struct sockaddr_in6 *sa6;
 
46
@@ -336,6 +341,27 @@ __res_vinit(res_state statp, int preinit
 
47
                                 sa6->sin6_addr = a6;
 
48
                                 sa6->sin6_family = AF_INET6;
 
49
                                 sa6->sin6_port = htons(NAMESERVER_PORT);
 
50
+
 
51
+                                if (el != NULL) {
 
52
+                                    int try_numericscope = 0;
 
53
+                                    if (IN6_IS_ADDR_LINKLOCAL(&a6)
 
54
+                                        || IN6_IS_ADDR_MC_LINKLOCAL(&a6)) {
 
55
+                                        sa6->sin6_scope_id = if_nametoindex(el + 1);
 
56
+                                        if (sa6->sin6_scope_id == 0)
 
57
+                                            try_numericscope = 1;
 
58
+                                    } else
 
59
+                                        try_numericscope = 1;
 
60
+
 
61
+                                        if (try_numericscope != 0) {
 
62
+                                            char *end;
 
63
+                                            assert(sizeof(uint32_t) <= sizeof(unsigned long));
 
64
+                                            sa6->sin6_scope_id = (uint32_t) strtoul(el + 1, &end, 10);
 
65
+                                            if (*end != '\0')
 
66
+                                                sa6->sin6_scope_id = 0;
 
67
+                                    }
 
68
+                                } else
 
69
+                                    sa6->sin6_scope_id = 0;
 
70
+
 
71
                                statp->_u._ext.nsaddrs[nservall] = sa6;
 
72
                                statp->_u._ext.nssocks[nservall] = -1;
 
73
                                statp->_u._ext.nsmap[nservall] = MAXNS + 1;
 
74