iputils/iputils-ping-interrupt.diff
Petr Vorel 8eebf12ed0 Accepting request 705286 from home:pevik:branches:network:utilities
- Update to version s20190515 (includes changes s20190324)
  * s20190324: 189 commits since s20180629 that include changing build
    system from autotools to meson, added rarpd and rdisc systemd service
    files, many fixes
  * s20190515 bugfix release (6 commits)
- User visible change: arping and clockdiff are moved from /usr/sbin
  to /usr/bin (respect upstream path)
- Backport patch 0001-build-sys-doc-Fix-the-dependency-on-xsltproc.patch
  (fixing build system)
- Add workaround patch meson-remove-setcap-setuid.sh.patch
- Remove 0001-tracepath-Fix-copying-input-IPv6-address.patch
  (included in s20190324 release)
- Refresh old patches (iputils-ping-interrupt.diff, iputils-sec-ping-unblock.diff)
- Changes caused by upstream switching to meson build system (drop sed build dependency)
- Added locales
- Fix typos

OBS-URL: https://build.opensuse.org/request/show/705286
OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=68
2019-05-24 17:12:38 +00:00

44 lines
1.2 KiB
Diff

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 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ping.c b/ping.c
index 06cc369..2c76677 100644
--- a/ping.c
+++ b/ping.c
@@ -92,6 +92,7 @@ static unsigned short in_cksum(const unsigned short *addr, int len, unsigned sho
static void pr_icmph(uint8_t type, uint8_t code, uint32_t info, struct icmphdr *icp);
static int parsetos(char *str);
static int parseflow(char *str);
+static void doexit (int);
static struct sockaddr_in source = { .sin_family = AF_INET };
char *device;
@@ -543,6 +544,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;
@@ -1619,3 +1622,8 @@ void ping4_install_filter(socket_st *sock)
if (setsockopt(sock->fd, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter)))
error(0, errno, _("WARNING: failed to install socket filter"));
}
+
+static void doexit(int signo __attribute__((unused)))
+{
+ exit (1);
+}
--
2.21.0