From 4900fcebe05ff614a3a590f1f5a8e034e227112a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Vok=C3=A1l?= Date: Mon, 6 Feb 2006 10:02:24 +0000 Subject: [PATCH] - ping clean-up, added new ICMP warning messages --- iputils-ping_cleanup.patch | 97 ++++++++++++++++++++++++++++++++++++++ iputils.spec | 9 +++- 2 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 iputils-ping_cleanup.patch diff --git a/iputils-ping_cleanup.patch b/iputils-ping_cleanup.patch new file mode 100644 index 0000000..0c133fd --- /dev/null +++ b/iputils-ping_cleanup.patch @@ -0,0 +1,97 @@ +--- iputils/ping6.c.OLD 2006-02-06 10:34:35.000000000 +0100 ++++ iputils/ping6.c 2006-02-06 10:35:38.000000000 +0100 +@@ -353,7 +353,7 @@ + hostname = target; + + if (ipv6_addr_any(&source.sin6_addr)) { +- int alen; ++ socklen_t alen; + int probe_fd = socket(AF_INET6, SOCK_DGRAM, 0); + + if (probe_fd < 0) { +--- iputils/ping.c.OLD 2006-02-06 10:34:35.000000000 +0100 ++++ iputils/ping.c 2006-02-06 10:34:35.000000000 +0100 +@@ -253,7 +253,7 @@ + } + + if (source.sin_addr.s_addr == 0) { +- int alen; ++ socklen_t alen; + struct sockaddr_in dst = whereto; + int probe_fd = socket(AF_INET, SOCK_DGRAM, 0); + +@@ -855,9 +855,36 @@ + case ICMP_SR_FAILED: + printf("Source Route Failed\n"); + break; ++ case ICMP_NET_UNKNOWN: ++ printf("Destination Net Unknown\n"); ++ break; ++ case ICMP_HOST_UNKNOWN: ++ printf("Destination Host Unknown\n"); ++ break; ++ case ICMP_HOST_ISOLATED: ++ printf("Source Host Isolated\n"); ++ break; ++ case ICMP_NET_ANO: ++ printf("Destination Net Prohibited\n"); ++ break; ++ case ICMP_HOST_ANO: ++ printf("Destination Host Prohibited\n"); ++ break; ++ case ICMP_NET_UNR_TOS: ++ printf("Destination Net Unreachable for Type of Service\n"); ++ break; ++ case ICMP_HOST_UNR_TOS: ++ printf("Destination Host Unreachable for Type of Service\n"); ++ break; + case ICMP_PKT_FILTERED: + printf("Packet filtered\n"); + break; ++ case ICMP_PREC_VIOLATION: ++ printf("Precedence Violation\n"); ++ break; ++ case ICMP_PREC_CUTOFF: ++ printf("Precedence Cutoff\n"); ++ break; + default: + printf("Dest Unreachable, Bad Code: %d\n", code); + break; +--- iputils/ping_common.c.OLD 2006-02-06 10:34:35.000000000 +0100 ++++ iputils/ping_common.c 2006-02-06 10:34:35.000000000 +0100 +@@ -67,7 +67,7 @@ + int ii, jj, kk; + int pat[16]; + char *cp; +- char *bp = outpack+8; ++ unsigned char *bp = outpack+8; + + for (cp = patp; *cp; cp++) { + if (!isxdigit(*cp)) { +@@ -393,7 +393,7 @@ + void sock_setbufs(int icmp_sock, int alloc) + { + int rcvbuf, hold; +- int tmplen = sizeof(hold); ++ socklen_t tmplen = sizeof(hold); + + if (!sndbuf) + sndbuf = alloc; +@@ -464,7 +464,7 @@ + + if (!(options & F_PINGFILLED)) { + int i; +- char *p = outpack+8; ++ unsigned char *p = outpack+8; + + /* Do not forget about case of small datalen, + * fill timestamp area too! +@@ -819,7 +819,7 @@ + } + if (pipesize > 1) + printf(", pipe %d", pipesize); +- if (ntransmitted > 1 && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) { ++ if (ntransmitted > 1 && nreceived && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) { + int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1); + printf(", ipg/ewma %d.%03d/%d.%03d ms", + ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000); diff --git a/iputils.spec b/iputils.spec index 2219f6a..b30466d 100644 --- a/iputils.spec +++ b/iputils.spec @@ -1,7 +1,7 @@ Summary: Network monitoring tools including ping. Name: iputils Version: 20020927 -Release: 33 +Release: 34 License: BSD Group: System Environment/Daemons Source0: http://www.tux.org/pub/net/ip-routing/%{name}-ss020927.tar.gz @@ -28,6 +28,7 @@ Patch17: iputils-flood.patch Patch18: iputils-ping-168166.patch Patch19: iputils-ipv6-hoplimit.patch Patch20: iputils-gcc41.patch +Patch21: iputils-ping_cleanup.patch Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-root BuildPreReq: docbook-utils perl-SGMLSpm @@ -63,6 +64,7 @@ the target machine is alive and receiving network traffic. %patch18 -p1 -b .memset %patch19 -p1 -b .hoplimit %patch20 -p1 -b .gcc41 +%patch21 -p1 -b .cleanup %build %ifarch s390 s390x @@ -162,7 +164,10 @@ rm -rf ${RPM_BUILD_ROOT} %config(noreplace) %{_sysconfdir}/rc.d/init.d/rdisc %changelog -* Wed Jan 25 2006 Radek Vokál -33 +* Mon Feb 06 2006 Radek Vokál 20020927-34 +- ping clean-up, added new ICMP warning messages + +* Wed Jan 25 2006 Radek Vokál 20020927-33 - gcc patch, warnings cleaned-up * Tue Dec 13 2005 Radek Vokal 20020927-32