patch-src_tcpspray_c.orig 1015 B

12345678910111213141516171819202122232425262728293031
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- ndisc6-0.9.8.orig/src/tcpspray.c 2008-05-01 14:52:28.000000000 +0200
  3. +++ ndisc6-0.9.8/src/tcpspray.c 2009-05-10 19:11:15.000000000 +0200
  4. @@ -60,7 +60,7 @@ static unsigned verbose = 0;
  5. static int tcpconnect (const char *host, const char *serv)
  6. {
  7. - struct addrinfo hints, *res;
  8. + struct addrinfo hints, *res, *p;
  9. memset (&hints, 0, sizeof (hints));
  10. hints.ai_family = family;
  11. @@ -78,7 +78,7 @@ static int tcpconnect (const char *host,
  12. val = -1;
  13. - for (struct addrinfo *p = res; (p != NULL) && (val == -1); p = p->ai_next)
  14. + for (p = res; (p != NULL) && (val == -1); p = p->ai_next)
  15. {
  16. val = socket (p->ai_family, p->ai_socktype, p->ai_protocol);
  17. if (val == -1)
  18. @@ -172,7 +172,8 @@ tcpspray (const char *host, const char *
  19. switch (child)
  20. {
  21. case 0:
  22. - for (unsigned i = 0; i < n; i++)
  23. + unsigned int i;
  24. + for (i = 0; i < n; i++)
  25. {
  26. ssize_t val = recv (fd, block, blen, MSG_WAITALL);
  27. if (val != (ssize_t)blen)