iputils/iputils-ping-interrupt.diff

41 lines
1.0 KiB
Diff
Raw Normal View History

From 41e442fea26f20ceb815306777d36361575825cc Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Mon, 26 Aug 2013 13:05:01 +0200
Subject: Allow ping to be interrupted
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
Accepting request 619908 from home:pevik:branches:network:utilities - Update to version s20180629 * ping: Fix signed overflow/conversion warning * ping: Fix ping name encoded using ACE on C locale * fix checksum always success in IPv4 ping. * ping6: Fix device binding * Ping: Correct rounding of timing displays * docs: Tiny fixes in README.md * doc/ping: Update Interface section * doc/ping: Replace deprecated commands in "SEE ALSO" section * Revert "correctly initialize first hop" * tracepath: Support calling `tracepath` as `tracepath4` or `tracepath6` * ping: remove spurious error message * tracepath: fix heap-buffer-overflow [asan] * arping: do not use libsysfs to read from /sys * .travis.yml: corrected variable values in matrix * .travis.yml: install libidn2 * ping: use libidn2 instead of libidn * ping: Remove workaround for bug in IP_RECVERR on raw sockets * ping6: simplified IDNA usage * traceroute6: use getaddrinfo IDNA conversion * arping,tracepath: removed unused idna header * cleanup: really old code, simplify little bit * licenses: fill missing clockdiff.c and ping_common.c license * LICENSE: convert BSD4 to BSD3 license * doc: ping - document mdev behaviour * LICENSE: add information about licenses * ping: fix incorrect packet loss calculation * doc: convert from converting SGML to XML * travis-ci: cleanup and switch to Ubuntu 14.04 build * RELNOTES: deprecated in favor of git history & github * remove iputils.spec * ping: fix conflicting defines * ping: flowinfo: fixup checks for flowinfo and also add decimal numbers support * ping: parsetos verification is enough, allow decimal values * ping: fix typo in error tos error message * meson: add experimental meson buildsystem support * gitignore: prepare for Meson * ping: read from error queue when POLLERR is set * ping_common.c: POLLERRR is ignored in events * ping: fix pmtu discovery for ipv6 * traceroute6: Fix traceroute to IPv6 address * traceroute6: Fix leaking the idn memory * traceroute6: Fix use after free for hostname * tracepath,doc: Added -4, -6 Parameter in doc and void usage(void) * fix multicast setsockopt calls on big endian * arping: exit if network disappears while running * ping: prevent possible double free after cap_free() * Add strict pattern matching on response when pattern was provided * traceroute6: Fix udp packet port specification. - Removed patches (taken from upstream, now in tree) * iputils-add-license-info.diff * iputils-ping-fix-pmtu-for-ipv6.patch * iputils-remove-bogus-check-required-for-2.4.9-kernels.patch - Rebased patches * iputils-ping-interrupt.diff * iputils-sec-ping-unblock.diff - Add build dependency docbook-xsl-stylesheets (required by man pages) - Add tracepath6 man page, updated list of unwanted man enties (ipg, pgset) - Removed RELNOTES (upstream removed it) OBS-URL: https://build.opensuse.org/request/show/619908 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=64
2018-07-04 00:02:17 +02:00
ping.c | 8 ++++++++
1 file changed, 8 insertions(+)
Accepting request 397465 from home:markoschandras:branches:network:utilities - Update to version s20160308 (Changes taken from the RELNOTES file) * use syntax compatible with busybox date in Makefile * 'admin prohibited' should print !X not !S. * Makefile: use #define as in previous code changes * doc/Makefile: require bash, because we use pushd and popd * doc: don't timestamp manpages by default * ping: status() now returns received/transmitted instead of trans/recv * ping: don't mess with internals of struct msghdr * ping: ICMP error replies while errno < 0 is a hard error * ping: always use POSIX locale when parsing -i * ping: link against libm * made ping functions protocol independent * ping: perform dual-stack ping by default * ping: remove obsolete preprocessor directives * ping: avoid name clashes between IPv4 and IPv6 code * ping: merge all ping header files into a single one * ping: merge `ping6` command into `ping` * ping: refactor ping options * ping: refactor ping socket code * ping: merge IPv4 and IPv6 `pr_addr()` * ping: fix defines and libs in Makefile * ping: handle single protocol systems * iputils ping/ping6: Add a function to check if a packet is ours * ping: Add <linux/types.h> to fix compilation error. * ping6: Use GNUTLS API directly for MD5. (v2) * ping6: Use libgcrypt instead of gnutls for MD5. * Allow ping to use IPv6 addresses * ping,ping6 doc: More description on CAP_NET_RAW usage. * if IPv4 resolving fails fallback to ping6 * ping: in usage print the 'ping -6' options as well OBS-URL: https://build.opensuse.org/request/show/397465 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=41
2016-05-23 17:21:37 +02:00
Index: iputils/ping.c
===================================================================
--- iputils.orig/ping.c
+++ iputils/ping.c
Accepting request 619908 from home:pevik:branches:network:utilities - Update to version s20180629 * ping: Fix signed overflow/conversion warning * ping: Fix ping name encoded using ACE on C locale * fix checksum always success in IPv4 ping. * ping6: Fix device binding * Ping: Correct rounding of timing displays * docs: Tiny fixes in README.md * doc/ping: Update Interface section * doc/ping: Replace deprecated commands in "SEE ALSO" section * Revert "correctly initialize first hop" * tracepath: Support calling `tracepath` as `tracepath4` or `tracepath6` * ping: remove spurious error message * tracepath: fix heap-buffer-overflow [asan] * arping: do not use libsysfs to read from /sys * .travis.yml: corrected variable values in matrix * .travis.yml: install libidn2 * ping: use libidn2 instead of libidn * ping: Remove workaround for bug in IP_RECVERR on raw sockets * ping6: simplified IDNA usage * traceroute6: use getaddrinfo IDNA conversion * arping,tracepath: removed unused idna header * cleanup: really old code, simplify little bit * licenses: fill missing clockdiff.c and ping_common.c license * LICENSE: convert BSD4 to BSD3 license * doc: ping - document mdev behaviour * LICENSE: add information about licenses * ping: fix incorrect packet loss calculation * doc: convert from converting SGML to XML * travis-ci: cleanup and switch to Ubuntu 14.04 build * RELNOTES: deprecated in favor of git history & github * remove iputils.spec * ping: fix conflicting defines * ping: flowinfo: fixup checks for flowinfo and also add decimal numbers support * ping: parsetos verification is enough, allow decimal values * ping: fix typo in error tos error message * meson: add experimental meson buildsystem support * gitignore: prepare for Meson * ping: read from error queue when POLLERR is set * ping_common.c: POLLERRR is ignored in events * ping: fix pmtu discovery for ipv6 * traceroute6: Fix traceroute to IPv6 address * traceroute6: Fix leaking the idn memory * traceroute6: Fix use after free for hostname * tracepath,doc: Added -4, -6 Parameter in doc and void usage(void) * fix multicast setsockopt calls on big endian * arping: exit if network disappears while running * ping: prevent possible double free after cap_free() * Add strict pattern matching on response when pattern was provided * traceroute6: Fix udp packet port specification. - Removed patches (taken from upstream, now in tree) * iputils-add-license-info.diff * iputils-ping-fix-pmtu-for-ipv6.patch * iputils-remove-bogus-check-required-for-2.4.9-kernels.patch - Rebased patches * iputils-ping-interrupt.diff * iputils-sec-ping-unblock.diff - Add build dependency docbook-xsl-stylesheets (required by man pages) - Add tracepath6 man page, updated list of unwanted man enties (ipg, pgset) - Removed RELNOTES (upstream removed it) OBS-URL: https://build.opensuse.org/request/show/619908 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=64
2018-07-04 00:02:17 +02:00
@@ -94,6 +94,7 @@ static unsigned short in_cksum(const unsigned short *addr, int len, unsigned sho
static void pr_icmph(__u8 type, __u8 code, __u32 info, struct icmphdr *icp);
static int parsetos(char *str);
Accepting request 619908 from home:pevik:branches:network:utilities - Update to version s20180629 * ping: Fix signed overflow/conversion warning * ping: Fix ping name encoded using ACE on C locale * fix checksum always success in IPv4 ping. * ping6: Fix device binding * Ping: Correct rounding of timing displays * docs: Tiny fixes in README.md * doc/ping: Update Interface section * doc/ping: Replace deprecated commands in "SEE ALSO" section * Revert "correctly initialize first hop" * tracepath: Support calling `tracepath` as `tracepath4` or `tracepath6` * ping: remove spurious error message * tracepath: fix heap-buffer-overflow [asan] * arping: do not use libsysfs to read from /sys * .travis.yml: corrected variable values in matrix * .travis.yml: install libidn2 * ping: use libidn2 instead of libidn * ping: Remove workaround for bug in IP_RECVERR on raw sockets * ping6: simplified IDNA usage * traceroute6: use getaddrinfo IDNA conversion * arping,tracepath: removed unused idna header * cleanup: really old code, simplify little bit * licenses: fill missing clockdiff.c and ping_common.c license * LICENSE: convert BSD4 to BSD3 license * doc: ping - document mdev behaviour * LICENSE: add information about licenses * ping: fix incorrect packet loss calculation * doc: convert from converting SGML to XML * travis-ci: cleanup and switch to Ubuntu 14.04 build * RELNOTES: deprecated in favor of git history & github * remove iputils.spec * ping: fix conflicting defines * ping: flowinfo: fixup checks for flowinfo and also add decimal numbers support * ping: parsetos verification is enough, allow decimal values * ping: fix typo in error tos error message * meson: add experimental meson buildsystem support * gitignore: prepare for Meson * ping: read from error queue when POLLERR is set * ping_common.c: POLLERRR is ignored in events * ping: fix pmtu discovery for ipv6 * traceroute6: Fix traceroute to IPv6 address * traceroute6: Fix leaking the idn memory * traceroute6: Fix use after free for hostname * tracepath,doc: Added -4, -6 Parameter in doc and void usage(void) * fix multicast setsockopt calls on big endian * arping: exit if network disappears while running * ping: prevent possible double free after cap_free() * Add strict pattern matching on response when pattern was provided * traceroute6: Fix udp packet port specification. - Removed patches (taken from upstream, now in tree) * iputils-add-license-info.diff * iputils-ping-fix-pmtu-for-ipv6.patch * iputils-remove-bogus-check-required-for-2.4.9-kernels.patch - Rebased patches * iputils-ping-interrupt.diff * iputils-sec-ping-unblock.diff - Add build dependency docbook-xsl-stylesheets (required by man pages) - Add tracepath6 man page, updated list of unwanted man enties (ipg, pgset) - Removed RELNOTES (upstream removed it) OBS-URL: https://build.opensuse.org/request/show/619908 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=64
2018-07-04 00:02:17 +02:00
static int parseflow(char *str);
+static void doexit (int);
static struct {
struct cmsghdr cm;
Accepting request 619908 from home:pevik:branches:network:utilities - Update to version s20180629 * ping: Fix signed overflow/conversion warning * ping: Fix ping name encoded using ACE on C locale * fix checksum always success in IPv4 ping. * ping6: Fix device binding * Ping: Correct rounding of timing displays * docs: Tiny fixes in README.md * doc/ping: Update Interface section * doc/ping: Replace deprecated commands in "SEE ALSO" section * Revert "correctly initialize first hop" * tracepath: Support calling `tracepath` as `tracepath4` or `tracepath6` * ping: remove spurious error message * tracepath: fix heap-buffer-overflow [asan] * arping: do not use libsysfs to read from /sys * .travis.yml: corrected variable values in matrix * .travis.yml: install libidn2 * ping: use libidn2 instead of libidn * ping: Remove workaround for bug in IP_RECVERR on raw sockets * ping6: simplified IDNA usage * traceroute6: use getaddrinfo IDNA conversion * arping,tracepath: removed unused idna header * cleanup: really old code, simplify little bit * licenses: fill missing clockdiff.c and ping_common.c license * LICENSE: convert BSD4 to BSD3 license * doc: ping - document mdev behaviour * LICENSE: add information about licenses * ping: fix incorrect packet loss calculation * doc: convert from converting SGML to XML * travis-ci: cleanup and switch to Ubuntu 14.04 build * RELNOTES: deprecated in favor of git history & github * remove iputils.spec * ping: fix conflicting defines * ping: flowinfo: fixup checks for flowinfo and also add decimal numbers support * ping: parsetos verification is enough, allow decimal values * ping: fix typo in error tos error message * meson: add experimental meson buildsystem support * gitignore: prepare for Meson * ping: read from error queue when POLLERR is set * ping_common.c: POLLERRR is ignored in events * ping: fix pmtu discovery for ipv6 * traceroute6: Fix traceroute to IPv6 address * traceroute6: Fix leaking the idn memory * traceroute6: Fix use after free for hostname * tracepath,doc: Added -4, -6 Parameter in doc and void usage(void) * fix multicast setsockopt calls on big endian * arping: exit if network disappears while running * ping: prevent possible double free after cap_free() * Add strict pattern matching on response when pattern was provided * traceroute6: Fix udp packet port specification. - Removed patches (taken from upstream, now in tree) * iputils-add-license-info.diff * iputils-ping-fix-pmtu-for-ipv6.patch * iputils-remove-bogus-check-required-for-2.4.9-kernels.patch - Rebased patches * iputils-ping-interrupt.diff * iputils-sec-ping-unblock.diff - Add build dependency docbook-xsl-stylesheets (required by man pages) - Add tracepath6 man page, updated list of unwanted man enties (ipg, pgset) - Removed RELNOTES (upstream removed it) OBS-URL: https://build.opensuse.org/request/show/619908 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=64
2018-07-04 00:02:17 +02:00
@@ -572,6 +573,8 @@ int ping4_run(int argc, char **argv, struct addrinfo *ai, socket_st *sock)
options |= F_SOURCEROUTE;
}
}
+ set_signal(SIGINT, doexit);
+
while (argc > 0) {
target = *argv;
Accepting request 619908 from home:pevik:branches:network:utilities - Update to version s20180629 * ping: Fix signed overflow/conversion warning * ping: Fix ping name encoded using ACE on C locale * fix checksum always success in IPv4 ping. * ping6: Fix device binding * Ping: Correct rounding of timing displays * docs: Tiny fixes in README.md * doc/ping: Update Interface section * doc/ping: Replace deprecated commands in "SEE ALSO" section * Revert "correctly initialize first hop" * tracepath: Support calling `tracepath` as `tracepath4` or `tracepath6` * ping: remove spurious error message * tracepath: fix heap-buffer-overflow [asan] * arping: do not use libsysfs to read from /sys * .travis.yml: corrected variable values in matrix * .travis.yml: install libidn2 * ping: use libidn2 instead of libidn * ping: Remove workaround for bug in IP_RECVERR on raw sockets * ping6: simplified IDNA usage * traceroute6: use getaddrinfo IDNA conversion * arping,tracepath: removed unused idna header * cleanup: really old code, simplify little bit * licenses: fill missing clockdiff.c and ping_common.c license * LICENSE: convert BSD4 to BSD3 license * doc: ping - document mdev behaviour * LICENSE: add information about licenses * ping: fix incorrect packet loss calculation * doc: convert from converting SGML to XML * travis-ci: cleanup and switch to Ubuntu 14.04 build * RELNOTES: deprecated in favor of git history & github * remove iputils.spec * ping: fix conflicting defines * ping: flowinfo: fixup checks for flowinfo and also add decimal numbers support * ping: parsetos verification is enough, allow decimal values * ping: fix typo in error tos error message * meson: add experimental meson buildsystem support * gitignore: prepare for Meson * ping: read from error queue when POLLERR is set * ping_common.c: POLLERRR is ignored in events * ping: fix pmtu discovery for ipv6 * traceroute6: Fix traceroute to IPv6 address * traceroute6: Fix leaking the idn memory * traceroute6: Fix use after free for hostname * tracepath,doc: Added -4, -6 Parameter in doc and void usage(void) * fix multicast setsockopt calls on big endian * arping: exit if network disappears while running * ping: prevent possible double free after cap_free() * Add strict pattern matching on response when pattern was provided * traceroute6: Fix udp packet port specification. - Removed patches (taken from upstream, now in tree) * iputils-add-license-info.diff * iputils-ping-fix-pmtu-for-ipv6.patch * iputils-remove-bogus-check-required-for-2.4.9-kernels.patch - Rebased patches * iputils-ping-interrupt.diff * iputils-sec-ping-unblock.diff - Add build dependency docbook-xsl-stylesheets (required by man pages) - Add tracepath6 man page, updated list of unwanted man enties (ipg, pgset) - Removed RELNOTES (upstream removed it) OBS-URL: https://build.opensuse.org/request/show/619908 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=64
2018-07-04 00:02:17 +02:00
@@ -1711,3 +1714,8 @@ void usage(void)
ping6_usage(1);
exit(2);
}
+
+static void doexit(int signo)
+{
+ exit (1);
+}