aboutsummaryrefslogtreecommitdiffstats
path: root/package/mdnsresponder/mDNSResponder-107.6-bcopy.patch
blob: dc9f5b533f40138d4b78fd068de53d59646aa24d (plain)
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
diff -urN mDNSResponder-107.6-0rig/mDNSPosix/NetMonitor.c mDNSResponder-107.6/mDNSPosix/NetMonitor.c
--- mDNSResponder-107.6-0rig/mDNSPosix/NetMonitor.c	2006-08-15 01:24:46.000000000 +0200
+++ mDNSResponder-107.6/mDNSPosix/NetMonitor.c	2007-09-26 11:56:22.000000000 +0200
@@ -30,6 +30,9 @@
     Change History (most recent first):
 
 $Log: NetMonitor.c,v $
+Revision 1.82-buildroot  2007/09/26 ulfs
+Replace deprecated bcopy with memmove
+
 Revision 1.82  2006/08/14 23:24:46  cheshire
 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
 
@@ -308,7 +311,7 @@
 
 #include <stdio.h>			// For printf()
 #include <stdlib.h>			// For malloc()
-#include <string.h>			// For bcopy()
+#include <string.h>			// For memmove()
 #include <time.h>			// For "struct tm" etc.
 #include <signal.h>			// For SIGINT, SIGTERM
 #include <netdb.h>			// For gethostbyname()
@@ -1155,7 +1158,7 @@
 			else if (inet_pton(AF_INET6, argv[i], &s6) == 1)
 				{
 				a.type = mDNSAddrType_IPv6;
-				bcopy(&s6, &a.ip.v6, sizeof(a.ip.v6));
+				memmove(&a.ip.v6, &s6, sizeof(a.ip.v6));
 				}
 			else
 				{
diff -urN mDNSResponder-107.6-0rig/mDNSPosix/PosixDaemon.c mDNSResponder-107.6/mDNSPosix/PosixDaemon.c
--- mDNSResponder-107.6-0rig/mDNSPosix/PosixDaemon.c	2006-08-29 08:24:34.000000000 +0200
+++ mDNSResponder-107.6/mDNSPosix/PosixDaemon.c	2007-09-26 12:02:01.000000000 +0200
@@ -231,8 +231,8 @@
 	mDNS_PlatformSupport	platformStorage;
 	mStatus					err;
 
-	bzero(&mDNSRecord, sizeof mDNSRecord);
-	bzero(&platformStorage, sizeof platformStorage);
+	memset(&mDNSRecord, '\0', sizeof mDNSRecord);
+	memset(&platformStorage, '\0', sizeof platformStorage);
 
 	ParseCmdLinArgs(argc, argv);
 
@@ -317,7 +317,6 @@
 		LogMalloc("malloc( %s : %lu ) = %p", msg, size, &mem[2]);
 		mem[0] = 0xDEAD1234;
 		mem[1] = size;
-		//bzero(&mem[2], size);
 		memset(&mem[2], 0xFF, size);
 //		validatelists(&mDNSStorage);
 		return(&mem[2]);
@@ -336,7 +335,6 @@
 		if (mem[1] > 8000)
 			{ LogMsg("free( %s : %ld @ %p) too big!", msg, mem[1], &mem[2]); return; }
 		LogMalloc("free( %s : %ld @ %p)", msg, mem[1], &mem[2]);
-		//bzero(mem, mem[1]+8);
 		memset(mem, 0xDD, mem[1]+8);
 //		validatelists(&mDNSStorage);
 		free(mem);
diff -urN mDNSResponder-107.6-0rig/mDNSShared/dnssd_clientstub.c mDNSResponder-107.6/mDNSShared/dnssd_clientstub.c
--- mDNSResponder-107.6-0rig/mDNSShared/dnssd_clientstub.c	2006-09-07 06:43:12.000000000 +0200
+++ mDNSResponder-107.6/mDNSShared/dnssd_clientstub.c	2007-09-26 12:05:10.000000000 +0200
@@ -325,7 +325,7 @@
     msg = malloc(*len);
     if (!msg) return NULL;
 
-    bzero(msg, *len);
+    memset(msg, '\0', *len);
     hdr = (void *)msg;
     hdr->datalen = datalen;
     hdr->version = VERSION;
@@ -425,7 +425,7 @@
         // setup temporary error socket
         if ((listenfd = socket(AF_DNSSD, SOCK_STREAM, 0)) < 0)
             goto cleanup;
-        bzero(&caddr, sizeof(caddr));
+        memset(&caddr, '\0', sizeof(caddr));
 
 #if defined(USE_TCP_LOOPBACK)
 			{
diff -urN mDNSResponder-107.6-0rig/mDNSShared/uds_daemon.c mDNSResponder-107.6/mDNSShared/uds_daemon.c
--- mDNSResponder-107.6-0rig/mDNSShared/uds_daemon.c	2006-08-29 08:24:36.000000000 +0200
+++ mDNSResponder-107.6/mDNSShared/uds_daemon.c	2007-09-26 12:04:21.000000000 +0200
@@ -990,7 +990,7 @@
 		goto error;
 		}
 
-    bzero(&laddr, sizeof(laddr));
+    memset(&laddr,'\0', sizeof(laddr));
 
 	#if defined(USE_TCP_LOOPBACK)
 		{
@@ -1291,7 +1291,7 @@
 	// allocate a request_state struct that will live with the socket
     rstate = mallocL("connect_callback", sizeof(request_state));
     if (!rstate) FatalError("ERROR: malloc");
-    bzero(rstate, sizeof(request_state));
+    memset(rstate, '\0', sizeof(request_state));
     rstate->ts = t_morecoming;
     rstate->sd = sd;
     
@@ -1389,7 +1389,7 @@
 			{
 			char ctrl_path[MAX_CTLPATH];
 			get_string(&rstate->msgdata, ctrl_path, 256);	// path is first element in message buffer
-			bzero(&cliaddr, sizeof(cliaddr));
+			memset(&cliaddr, '\0', sizeof(cliaddr));
 			cliaddr.sun_family = AF_LOCAL;
 			strcpy(cliaddr.sun_path, ctrl_path);
 			}
@@ -1495,7 +1495,7 @@
 
     q = mallocL("DNSQuestion", sizeof(DNSQuestion));
     if (!q) FatalError("ERROR: handle_query - malloc");
-    bzero(q, sizeof(DNSQuestion));
+    memset(q, '\0', sizeof(DNSQuestion));
 
     q->InterfaceID      = InterfaceID;
     q->Target           = zeroAddr;
@@ -1576,7 +1576,7 @@
 
     // set up termination info
     term = mallocL("handle_resolve_request", sizeof(resolve_termination_t));
-    bzero(term, sizeof(*term));
+    memset(term, '\0', sizeof(*term));
     if (!term) FatalError("ERROR: malloc");
 
     // format questions
@@ -2635,7 +2635,7 @@
 		return mStatus_NoMemoryErr;
         }
         
-    bzero(extra, sizeof(ExtraResourceRecord));  // OK if oversized rdata not zero'd
+    memset(extra, '\0', sizeof(ExtraResourceRecord));  // OK if oversized rdata not zero'd
     extra->r.resrec.rrtype = rrtype;
     extra->r.rdatastorage.MaxRDLength = (mDNSu16) size;
     extra->r.resrec.rdlength = rdlen;
@@ -3208,7 +3208,7 @@
     
     rr = mallocL("read_rr_from_ipc_msg", sizeof(AuthRecord) - sizeof(RDataBody) + storage_size);
     if (!rr) FatalError("ERROR: malloc");
-    bzero(rr, sizeof(AuthRecord));  // ok if oversized rdata not zero'd
+    memset(rr, '\0', sizeof(AuthRecord));  // ok if oversized rdata not zero'd
     
     mDNS_SetupResourceRecord(rr, mDNSNULL, mDNSPlatformInterfaceIDfromInterfaceIndex(gmDNS, interfaceIndex),
 		type, 0, (mDNSu8) ((flags & kDNSServiceFlagsShared) ? kDNSRecordTypeShared : kDNSRecordTypeUnique), mDNSNULL, mDNSNULL);
@@ -3337,7 +3337,7 @@
                 return t_error;
             	}
             rs->msgdata = rs->msgbuf;
-            bzero(rs->msgbuf, rs->hdr.datalen + MSG_PAD_BYTES);
+            memset(rs->msgbuf, '\0', rs->hdr.datalen + MSG_PAD_BYTES);
             }
         nleft = rs->hdr.datalen - rs->data_bytes;
         nread = recv(rs->sd, rs->msgbuf + rs->data_bytes, nleft, 0);
@@ -3431,14 +3431,14 @@
     totallen = (int) (datalen + sizeof(ipc_msg_hdr));
     reply = mallocL("create_reply", sizeof(reply_state));
     if (!reply) FatalError("ERROR: malloc");
-    bzero(reply, sizeof(reply_state));
+    memset(reply, '\0', sizeof(reply_state));
     reply->ts = t_morecoming;
     reply->sd = request->sd;
     reply->request = request;
     reply->len = totallen;
     reply->msgbuf = mallocL("create_reply", totallen);
     if (!reply->msgbuf) FatalError("ERROR: malloc");
-    bzero(reply->msgbuf, totallen);
+    memset(reply->msgbuf, '\0', totallen);
     reply->mhdr = (ipc_msg_hdr *)reply->msgbuf;
     reply->rhdr = (reply_hdr *)(reply->msgbuf + sizeof(ipc_msg_hdr));
     reply->sdata = reply->msgbuf + sizeof(ipc_msg_hdr) + sizeof(reply_hdr);