summaryrefslogtreecommitdiffstats
path: root/package/busybox/busybox-1.16.1-dnsd.patch
blob: 414ac33e3ee5aa37bf3a8a5a8bd468d58662f923 (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
diff -urpN busybox-1.16.1/include/platform.h busybox-1.16.1-dnsd/include/platform.h
--- busybox-1.16.1/include/platform.h	2010-03-28 10:43:35.000000000 -0700
+++ busybox-1.16.1-dnsd/include/platform.h	2010-04-14 10:06:10.888341149 -0700
@@ -291,10 +291,12 @@ typedef unsigned smalluint;
 #if 1 /* if needed: !defined(arch1) && !defined(arch2) */
 # define ALIGN1 __attribute__((aligned(1)))
 # define ALIGN2 __attribute__((aligned(2)))
+# define ALIGN4 __attribute__((aligned(4)))
 #else
 /* Arches which MUST have 2 or 4 byte alignment for everything are here */
 # define ALIGN1
 # define ALIGN2
+# define ALIGN4
 #endif
 
 
diff -urpN busybox-1.16.1/networking/dnsd.c busybox-1.16.1-dnsd/networking/dnsd.c
--- busybox-1.16.1/networking/dnsd.c	2010-03-28 10:43:36.000000000 -0700
+++ busybox-1.16.1-dnsd/networking/dnsd.c	2010-04-14 10:06:10.922348571 -0700
@@ -459,7 +459,8 @@ int dnsd_main(int argc UNUSED_PARAM, cha
 	unsigned lsa_size;
 	int udps, opts;
 	uint16_t port = 53;
-	uint8_t buf[MAX_PACK_LEN + 1];
+	/* Ensure buf is 32bit aligned (we need 16bit, but 32bit can't hurt) */
+	uint8_t buf[MAX_PACK_LEN + 1] ALIGN4;
 
 	opts = getopt32(argv, "vi:c:t:p:d", &listen_interface, &fileconf, &sttl, &sport);
 	//if (opts & 0x1) // -v