diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2007-01-22 14:38:18 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2007-01-22 14:38:18 +0000 |
commit | f320c2c12e38ed846233e77d82beb78b7c16da59 (patch) | |
tree | b37527bc8a5d692b6d0fe00da73f5048f383abde /pkgs/os-specific/linux/dietlibc/dns64.patch | |
parent | a7878ba0a7d1346ff93db78ece12588aa868b863 (diff) | |
download | nixlib-f320c2c12e38ed846233e77d82beb78b7c16da59.tar nixlib-f320c2c12e38ed846233e77d82beb78b7c16da59.tar.gz nixlib-f320c2c12e38ed846233e77d82beb78b7c16da59.tar.bz2 nixlib-f320c2c12e38ed846233e77d82beb78b7c16da59.tar.lz nixlib-f320c2c12e38ed846233e77d82beb78b7c16da59.tar.xz nixlib-f320c2c12e38ed846233e77d82beb78b7c16da59.tar.zst nixlib-f320c2c12e38ed846233e77d82beb78b7c16da59.zip |
* DNS resolution in dietlibc failed randomly on 64-bit platforms.
Patch backported from dietlibc CVS. svn path=/nixpkgs/trunk/; revision=7743
Diffstat (limited to 'pkgs/os-specific/linux/dietlibc/dns64.patch')
-rw-r--r-- | pkgs/os-specific/linux/dietlibc/dns64.patch | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/dietlibc/dns64.patch b/pkgs/os-specific/linux/dietlibc/dns64.patch new file mode 100644 index 000000000000..47d54d1d16b7 --- /dev/null +++ b/pkgs/os-specific/linux/dietlibc/dns64.patch @@ -0,0 +1,109 @@ +Only in dietlibc-0.30: CHANGES.orig +diff -rc dietlibc-0.30-orig/libcruft/dnscruft2.c dietlibc-0.30/libcruft/dnscruft2.c +*** dietlibc-0.30-orig/libcruft/dnscruft2.c 2005-05-01 22:08:25.000000000 +0200 +--- dietlibc-0.30/libcruft/dnscruft2.c 2007-01-22 15:32:18.000000000 +0100 +*************** +*** 5,11 **** + #include <netdb.h> + #include <stdlib.h> + #include <arpa/inet.h> +- #include <sys/poll.h> + #include <unistd.h> + #include <errno.h> + #include <arpa/nameser.h> +--- 5,10 ---- +diff -rc dietlibc-0.30-orig/libcruft/dnscruft.c dietlibc-0.30/libcruft/dnscruft.c +*** dietlibc-0.30-orig/libcruft/dnscruft.c 2006-06-18 20:32:35.000000000 +0200 +--- dietlibc-0.30/libcruft/dnscruft.c 2007-01-22 15:32:18.000000000 +0100 +*************** +*** 45,53 **** + tmp=socket(PF_INET6,SOCK_DGRAM,IPPROTO_UDP); + if (tmp<0) return; + fcntl(tmp,F_SETFD,FD_CLOEXEC); + si.sin6_family=AF_INET6; +- si.sin6_port=0; +- memset(&si.sin6_addr,0,16); + if (bind(tmp,(struct sockaddr*)&si,sizeof(si))) return; + __dns_fd6=tmp; + } +--- 45,52 ---- + tmp=socket(PF_INET6,SOCK_DGRAM,IPPROTO_UDP); + if (tmp<0) return; + fcntl(tmp,F_SETFD,FD_CLOEXEC); ++ memset(&si,0,sizeof(si)); + si.sin6_family=AF_INET6; + if (bind(tmp,(struct sockaddr*)&si,sizeof(si))) return; + __dns_fd6=tmp; + } +diff -rc dietlibc-0.30-orig/libcruft/res_mkquery.c dietlibc-0.30/libcruft/res_mkquery.c +*** dietlibc-0.30-orig/libcruft/res_mkquery.c 2004-11-10 18:45:17.000000000 +0100 +--- dietlibc-0.30/libcruft/res_mkquery.c 2007-01-22 15:32:18.000000000 +0100 +*************** +*** 42,51 **** + int res_mkquery(int op, const char *dname, int class, int type, char* data, + int datalen, const unsigned char* newrr, char* buf, int buflen) { + unsigned char packet[512]; +! unsigned long len=0; +! memmove(packet,dnspacket,12); + if ((_res.options&RES_RECURSE)==0) packet[2]=0; +- *(unsigned short*)packet=rand(); + { + unsigned char* x; + const char* y,* tmp; +--- 42,55 ---- + int res_mkquery(int op, const char *dname, int class, int type, char* data, + int datalen, const unsigned char* newrr, char* buf, int buflen) { + unsigned char packet[512]; +! unsigned long len; +! +! memcpy(packet,dnspacket,12); +! len=rand(); +! packet[0]=len; +! packet[1]=len>>8; +! len=0; + if ((_res.options&RES_RECURSE)==0) packet[2]=0; + { + unsigned char* x; + const char* y,* tmp; +diff -rc dietlibc-0.30-orig/libcruft/res_query.c dietlibc-0.30/libcruft/res_query.c +*** dietlibc-0.30-orig/libcruft/res_query.c 2005-10-14 17:37:59.000000000 +0200 +--- dietlibc-0.30/libcruft/res_query.c 2007-01-22 15:32:18.000000000 +0100 +*************** +*** 99,105 **** + duh[1].fd=pnpfd; + } else { + duh[1].fd=-1; +! duh[1].revents=0; + } + + #endif +--- 99,105 ---- + duh[1].fd=pnpfd; + } else { + duh[1].fd=-1; +! duh[1].events=0; + } + + #endif +diff -rc dietlibc-0.30-orig/syscalls.s/__guard.S dietlibc-0.30/syscalls.s/__guard.S +*** dietlibc-0.30-orig/syscalls.s/__guard.S 2006-04-07 17:33:20.000000000 +0200 +--- dietlibc-0.30/syscalls.s/__guard.S 2007-01-22 15:32:18.000000000 +0100 +*************** +*** 1,3 **** +--- 1,4 ---- ++ #include <endian.h> + .data + .type __guard,@object + .global __guard +*************** +*** 5,9 **** +--- 6,14 ---- + .global __stack_chk_guard + __guard: + __stack_chk_guard: ++ #if __WORDSIZE == 64 ++ .quad 0xaff00 ++ #else + .long 0xaff00 ++ #endif + |