about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/dietlibc/dns64.patch
blob: 47d54d1d16b71c00062367296b0d22823f85ce84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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