summaryrefslogtreecommitdiff
path: root/recipes/iputils/files/debian/fix-cmsghdr-offset-bug.diff
blob: 0c9bbd8ea068f05071081b166bd78a39f966ce4d (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
--- iputils-upstream/ping6.c	2007-10-28 12:24:10.000000000 -0400
+++ iputils/ping6.c	2007-10-28 12:19:18.000000000 -0400
@@ -414,7 +414,7 @@
 			fprintf(stderr, "ping: unknown iface %s\n", device);
 			exit(2);
 		}
-		cmsg = (struct cmsghdr*)cmsgbuf;
+		cmsg = (struct cmsghdr*)(cmsgbuf+cmsglen);
 		cmsglen += CMSG_SPACE(sizeof(*ipi));
 		cmsg->cmsg_len = CMSG_LEN(sizeof(*ipi));
 		cmsg->cmsg_level = SOL_IPV6;
@@ -486,7 +486,6 @@
 	/*
 	 *	select icmp echo reply as icmp type to receive
 	 */
-
 	ICMP6_FILTER_SETBLOCKALL(&filter);
 
 	if (!working_recverr) {
--- /tmp/ping6.c	2009-06-15 19:13:57.000000000 +0200
+++ iputils_20071127.orig/ping6.c	2009-06-15 19:14:40.000000000 +0200
@@ -415,14 +415,9 @@
 			exit(2);
 		}
 		cmsg = (struct cmsghdr*)(cmsgbuf+cmsglen);
-		cmsglen += CMSG_SPACE(sizeof(*ipi));
-		cmsg->cmsg_len = CMSG_LEN(sizeof(*ipi));
+		cmsglen += CMSG_SPACE(sizeof(ipi));
 		cmsg->cmsg_level = SOL_IPV6;
 		cmsg->cmsg_type = IPV6_PKTINFO;
-
-		ipi = (struct in6_pktinfo*)CMSG_DATA(cmsg);
-		memset(ipi, 0, sizeof(*ipi));
-		ipi->ipi6_ifindex = ifr.ifr_ifindex;
 	}
 
 	if ((whereto.sin6_addr.s6_addr16[0]&htons(0xff00)) == htons (0xff00)) {