2014-01-25 15:10:50 +01:00
|
|
|
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>
|
|
|
|
---
|
2018-07-04 00:02:17 +02:00
|
|
|
ping.c | 8 ++++++++
|
|
|
|
1 file changed, 8 insertions(+)
|
2014-01-25 15:10:50 +01:00
|
|
|
|
2016-05-23 17:21:37 +02:00
|
|
|
Index: iputils/ping.c
|
|
|
|
===================================================================
|
|
|
|
--- iputils.orig/ping.c
|
|
|
|
+++ iputils/ping.c
|
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
|
2013-07-23 11:17:26 +02:00
|
|
|
static void pr_icmph(__u8 type, __u8 code, __u32 info, struct icmphdr *icp);
|
|
|
|
static int parsetos(char *str);
|
2018-07-04 00:02:17 +02:00
|
|
|
static int parseflow(char *str);
|
2013-07-23 11:17:26 +02:00
|
|
|
+static void doexit (int);
|
|
|
|
|
|
|
|
static struct {
|
|
|
|
struct cmsghdr cm;
|
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)
|
2013-07-23 11:17:26 +02:00
|
|
|
options |= F_SOURCEROUTE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ set_signal(SIGINT, doexit);
|
|
|
|
+
|
|
|
|
while (argc > 0) {
|
|
|
|
target = *argv;
|
|
|
|
|
2018-07-04 00:02:17 +02:00
|
|
|
@@ -1711,3 +1714,8 @@ void usage(void)
|
2015-12-03 02:18:20 +01:00
|
|
|
ping6_usage(1);
|
2013-07-23 11:17:26 +02:00
|
|
|
exit(2);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+static void doexit(int signo)
|
|
|
|
+{
|
|
|
|
+ exit (1);
|
|
|
|
+}
|