0006-Fix-ping6-sender-address.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sat, 11 Jan 2014 17:08:59 +0100
  3. Subject: Fix ping6 sender address
  4. diff --git a/package/busybox/patches/960-ping6_sender_address.patch b/package/busybox/patches/960-ping6_sender_address.patch
  5. new file mode 100644
  6. index 0000000..7c56a6d
  7. --- /dev/null
  8. +++ b/package/busybox/patches/960-ping6_sender_address.patch
  9. @@ -0,0 +1,29 @@
  10. +--- a/networking/ping.c
  11. ++++ b/networking/ping.c
  12. +@@ -638,7 +638,7 @@ static void unpack4(char *buf, int sz, s
  13. + }
  14. + }
  15. + #if ENABLE_PING6
  16. +-static void unpack6(char *packet, int sz, /*struct sockaddr_in6 *from,*/ int hoplimit)
  17. ++static void unpack6(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit)
  18. + {
  19. + struct icmp6_hdr *icmppkt;
  20. + char buf[INET6_ADDRSTRLEN];
  21. +@@ -658,7 +658,7 @@ static void unpack6(char *packet, int sz
  22. + if (sz >= sizeof(struct icmp6_hdr) + sizeof(uint32_t))
  23. + tp = (uint32_t *) &icmppkt->icmp6_data8[4];
  24. + unpack_tail(sz, tp,
  25. +- inet_ntop(AF_INET6, &pingaddr.sin6.sin6_addr,
  26. ++ inet_ntop(AF_INET6, &from->sin6_addr,
  27. + buf, sizeof(buf)),
  28. + recv_seq, hoplimit);
  29. + } else if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST) {
  30. +@@ -808,7 +808,7 @@ static void ping6(len_and_sockaddr *lsa)
  31. + move_from_unaligned_int(hoplimit, CMSG_DATA(mp));
  32. + }
  33. + }
  34. +- unpack6(G.rcv_packet, c, /*&from,*/ hoplimit);
  35. ++ unpack6(G.rcv_packet, c, &from, hoplimit);
  36. + if (pingcount && nreceived >= pingcount)
  37. + break;
  38. + }