summaryrefslogtreecommitdiff
path: root/package/ndisc/patches/patch-src_tcpspray_c.orig
blob: 15106ea1c59c7719a197e10e75d580c7fcb521ba (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
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- ndisc6-0.9.8.orig/src/tcpspray.c	2008-05-01 14:52:28.000000000 +0200
+++ ndisc6-0.9.8/src/tcpspray.c	2009-05-10 19:11:15.000000000 +0200
@@ -60,7 +60,7 @@ static unsigned verbose = 0;
 
 static int tcpconnect (const char *host, const char *serv)
 {
-	struct addrinfo hints, *res;
+	struct addrinfo hints, *res, *p;
 
 	memset (&hints, 0, sizeof (hints));
 	hints.ai_family = family;
@@ -78,7 +78,7 @@ static int tcpconnect (const char *host,
 
 	val = -1;
 
-	for (struct addrinfo *p = res; (p != NULL) && (val == -1); p = p->ai_next)
+	for (p = res; (p != NULL) && (val == -1); p = p->ai_next)
 	{
 		val = socket (p->ai_family, p->ai_socktype, p->ai_protocol);
 		if (val == -1)
@@ -172,7 +172,8 @@ tcpspray (const char *host, const char *
 		switch (child)
 		{
 			case 0:
-				for (unsigned i = 0; i < n; i++)
+				unsigned int i;
+				for (i = 0; i < n; i++)
 				{
 					ssize_t val = recv (fd, block, blen, MSG_WAITALL);
 					if (val != (ssize_t)blen)