iputils/iputils-ping-interrupt.diff

42 lines
1.1 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>
---
ping.c | 9 +++++++++
1 file changed, 9 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 522166 from home:pevik:branches:network:utilities - Update to version s20161105 (Changes taken from the RELNOTES file) * ping: eliminate deadcode & simplify * ping: do not allow oversized packets to root * correctly initialize first hop * ping: fix ping -6 -I * arping,doc: fix documentation of -I * ping: fix error message when getting EACCES from connect() * renamed INSTALL to INSTALL.md * (re)structured INSTALL.md and transformed into markdown; added hint that installation into prefix has to be done with DESTDIR make variable and that there's no prefix support in configure, close #21 * ping: Silence GCC warnings when building with -fstrict-aliasing * tftpd: Drop supplementary groups for root * libgcrypt: fix static linking * doc: Inserted a missing word * tracepath6: avoid redundant family variable * tracepath: borrow everything good from tracepath6 * tracepath: switch to dual-stack operation * tracepath: remove now redundant tracepath6 * docs: fix parallel build of manpages * ping: remove assignments of values that are never read * docs: remove references to ping6 and traceroute6 * ping: work with older kernels that don't support ping sockets * Revert "ping_common.c: fix message flood when EPERM is encountered in ping" * reorder -I option parsing (boo#1057664) * ping: also bind the ICMP socket to the specific device - tracepath6 is now symlink to tracepath. OBS-URL: https://build.opensuse.org/request/show/522166 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=48
2017-09-12 15:53:00 +02:00
@@ -97,6 +97,7 @@ static void usage(void) __attribute__((noreturn));
static unsigned short in_cksum(const unsigned short *addr, int len, unsigned short salt);
static void pr_icmph(__u8 type, __u8 code, __u32 info, struct icmphdr *icp);
static int parsetos(char *str);
+static void doexit (int);
static struct {
struct cmsghdr cm;
Accepting request 522166 from home:pevik:branches:network:utilities - Update to version s20161105 (Changes taken from the RELNOTES file) * ping: eliminate deadcode & simplify * ping: do not allow oversized packets to root * correctly initialize first hop * ping: fix ping -6 -I * arping,doc: fix documentation of -I * ping: fix error message when getting EACCES from connect() * renamed INSTALL to INSTALL.md * (re)structured INSTALL.md and transformed into markdown; added hint that installation into prefix has to be done with DESTDIR make variable and that there's no prefix support in configure, close #21 * ping: Silence GCC warnings when building with -fstrict-aliasing * tftpd: Drop supplementary groups for root * libgcrypt: fix static linking * doc: Inserted a missing word * tracepath6: avoid redundant family variable * tracepath: borrow everything good from tracepath6 * tracepath: switch to dual-stack operation * tracepath: remove now redundant tracepath6 * docs: fix parallel build of manpages * ping: remove assignments of values that are never read * docs: remove references to ping6 and traceroute6 * ping: work with older kernels that don't support ping sockets * Revert "ping_common.c: fix message flood when EPERM is encountered in ping" * reorder -I option parsing (boo#1057664) * ping: also bind the ICMP socket to the specific device - tracepath6 is now symlink to tracepath. OBS-URL: https://build.opensuse.org/request/show/522166 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=48
2017-09-12 15:53:00 +02:00
@@ -579,6 +580,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 522166 from home:pevik:branches:network:utilities - Update to version s20161105 (Changes taken from the RELNOTES file) * ping: eliminate deadcode & simplify * ping: do not allow oversized packets to root * correctly initialize first hop * ping: fix ping -6 -I * arping,doc: fix documentation of -I * ping: fix error message when getting EACCES from connect() * renamed INSTALL to INSTALL.md * (re)structured INSTALL.md and transformed into markdown; added hint that installation into prefix has to be done with DESTDIR make variable and that there's no prefix support in configure, close #21 * ping: Silence GCC warnings when building with -fstrict-aliasing * tftpd: Drop supplementary groups for root * libgcrypt: fix static linking * doc: Inserted a missing word * tracepath6: avoid redundant family variable * tracepath: borrow everything good from tracepath6 * tracepath: switch to dual-stack operation * tracepath: remove now redundant tracepath6 * docs: fix parallel build of manpages * ping: remove assignments of values that are never read * docs: remove references to ping6 and traceroute6 * ping: work with older kernels that don't support ping sockets * Revert "ping_common.c: fix message flood when EPERM is encountered in ping" * reorder -I option parsing (boo#1057664) * ping: also bind the ICMP socket to the specific device - tracepath6 is now symlink to tracepath. OBS-URL: https://build.opensuse.org/request/show/522166 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=48
2017-09-12 15:53:00 +02:00
@@ -1699,3 +1702,9 @@ void usage(void)
ping6_usage(1);
exit(2);
}
+
+static void doexit(int signo)
+{
+ exit (1);
+}
+