From 82c3256061ba759fe4a6fe82e3789cc41bd313dc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 11 Jan 2014 17:13:30 +0100 Subject: [PATCH] Fix ping6 sender address --- .../0005-Fix-ping6-sender-address.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 patches/openwrt/0005-Fix-ping6-sender-address.patch diff --git a/patches/openwrt/0005-Fix-ping6-sender-address.patch b/patches/openwrt/0005-Fix-ping6-sender-address.patch new file mode 100644 index 00000000..c70848f4 --- /dev/null +++ b/patches/openwrt/0005-Fix-ping6-sender-address.patch @@ -0,0 +1,39 @@ +From: Matthias Schiffer +Date: Sat, 11 Jan 2014 17:08:59 +0100 +Subject: Fix ping6 sender address + +diff --git a/package/busybox/patches/960-ping6_sender_address.patch b/package/busybox/patches/960-ping6_sender_address.patch +new file mode 100644 +index 0000000..7c56a6d +--- /dev/null ++++ b/package/busybox/patches/960-ping6_sender_address.patch +@@ -0,0 +1,29 @@ ++--- a/networking/ping.c +++++ b/networking/ping.c ++@@ -638,7 +638,7 @@ static void unpack4(char *buf, int sz, s ++ } ++ } ++ #if ENABLE_PING6 ++-static void unpack6(char *packet, int sz, /*struct sockaddr_in6 *from,*/ int hoplimit) +++static void unpack6(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit) ++ { ++ struct icmp6_hdr *icmppkt; ++ char buf[INET6_ADDRSTRLEN]; ++@@ -658,7 +658,7 @@ static void unpack6(char *packet, int sz ++ if (sz >= sizeof(struct icmp6_hdr) + sizeof(uint32_t)) ++ tp = (uint32_t *) &icmppkt->icmp6_data8[4]; ++ unpack_tail(sz, tp, ++- inet_ntop(AF_INET6, &pingaddr.sin6.sin6_addr, +++ inet_ntop(AF_INET6, &from->sin6_addr, ++ buf, sizeof(buf)), ++ recv_seq, hoplimit); ++ } else if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST) { ++@@ -808,7 +808,7 @@ static void ping6(len_and_sockaddr *lsa) ++ move_from_unaligned_int(hoplimit, CMSG_DATA(mp)); ++ } ++ } ++- unpack6(G.rcv_packet, c, /*&from,*/ hoplimit); +++ unpack6(G.rcv_packet, c, &from, hoplimit); ++ if (pingcount && nreceived >= pingcount) ++ break; ++ }