summaryrefslogtreecommitdiff
path: root/network/hping3/patches/rtt_icmp_unreachable.diff
diff options
context:
space:
mode:
authorBrenton Earl <brent@exitstatusone.com>2015-11-09 17:29:10 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-11-09 17:29:10 +0700
commitbd2f952d409fa886d94d0be0ed35f8fae6698325 (patch)
treeb3336cad4340ada0a87ca6ffd117d2e1cf862a42 /network/hping3/patches/rtt_icmp_unreachable.diff
parent363df21b432a76f0d2bd6195e59b4a671c6d23e9 (diff)
downloadslackbuilds-bd2f952d409fa886d94d0be0ed35f8fae6698325.tar.gz
network/hping3: Add more patches + new maintainer.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/hping3/patches/rtt_icmp_unreachable.diff')
-rw-r--r--network/hping3/patches/rtt_icmp_unreachable.diff32
1 files changed, 32 insertions, 0 deletions
diff --git a/network/hping3/patches/rtt_icmp_unreachable.diff b/network/hping3/patches/rtt_icmp_unreachable.diff
new file mode 100644
index 0000000000..81fa6c194e
--- /dev/null
+++ b/network/hping3/patches/rtt_icmp_unreachable.diff
@@ -0,0 +1,32 @@
+
+Adds RTT handling for ICMP destination unreachable packets
+
+--- a/waitpacket.c
++++ b/waitpacket.c
+@@ -229,6 +229,7 @@
+ {
+ struct myicmphdr icmp;
+ struct myiphdr quoted_ip;
++ struct myudphdr quoted_udp;
+
+ /* Check if the packet can contain the ICMP header */
+ if (size < ICMPHDR_SIZE) {
+@@ -286,6 +287,18 @@
+ case 3:
+ if (!opt_quiet)
+ log_icmp_unreach(inet_ntoa(src), icmp.code);
++ if (quoted_ip.protocol == IPPROTO_UDP)
++ {
++ int sequence = 0, status;
++ float ms_delay = 0.0;
++ unsigned short port;
++
++ /* Get RTT for UDP packet */
++ memcpy(&quoted_udp, packet+ICMPHDR_SIZE+(quoted_ip.ihl<<2), sizeof(quoted_udp));
++ port = ntohs(quoted_udp.uh_sport);
++ status = rtt(&sequence, port, &ms_delay);
++ printf("status=%d port=%d seq=%d\n", status, port, sequence);
++ }
+ return 1;
+ case 11:
+ if (opt_traceroute)