diff --git a/iputils-20121221-sigalrm-unblock.patch b/iputils-20121221-sigalrm-unblock.patch new file mode 100644 index 0000000..3633f67 --- /dev/null +++ b/iputils-20121221-sigalrm-unblock.patch @@ -0,0 +1,32 @@ +Author: Rui Prior +Resolves: #1085971 + +--- iputils-s20121221-orig/arping.c 2014-04-10 15:41:29.158243387 +0100 ++++ iputils-s20121221-new/arping.c 2014-04-10 16:02:06.000000000 +0100 +@@ -1215,16 +1215,22 @@ main(int argc, char **argv) + socklen_t alen = sizeof(from); + int cc; + ++ sigemptyset(&sset); ++ sigaddset(&sset, SIGALRM); ++ sigaddset(&sset, SIGINT); ++ /* Unblock SIGALRM so that the previously called alarm() ++ * can prevent recvfrom from blocking forever in case the ++ * inherited procmask is blocking SIGALRM and no packet ++ * is received. */ ++ sigprocmask(SIG_UNBLOCK, &sset, &osset); ++ + if ((cc = recvfrom(s, packet, sizeof(packet), 0, + (struct sockaddr *)&from, &alen)) < 0) { + perror("arping: recvfrom"); + continue; + } + +- sigemptyset(&sset); +- sigaddset(&sset, SIGALRM); +- sigaddset(&sset, SIGINT); +- sigprocmask(SIG_BLOCK, &sset, &osset); ++ sigprocmask(SIG_BLOCK, &sset, NULL); + recv_pack(packet, cc, (struct sockaddr_ll *)&from); + sigprocmask(SIG_SETMASK, &osset, NULL); + } diff --git a/iputils.spec b/iputils.spec index 91afa99..ac03fa4 100644 --- a/iputils.spec +++ b/iputils.spec @@ -3,7 +3,7 @@ Summary: Network monitoring tools including ping Name: iputils Version: 20121221 -Release: 9%{?dist} +Release: 10%{?dist} # some parts are under the original BSD (ping.c) # some are under GPLv2+ (tracepath.c) License: BSD and GPLv2+ @@ -19,6 +19,7 @@ Patch0: iputils-20020927-rh.patch Patch1: iputils-ifenslave.patch Patch2: iputils-20121221-floodlocale.patch Patch3: iputils-20121221-eperm-flood.patch +Patch4: iputils-20121221-sigalrm-unblock.patch BuildRequires: docbook-utils perl-SGMLSpm BuildRequires: glibc-kernheaders >= 2.4-8.19 @@ -60,6 +61,7 @@ Queries. %patch1 -p1 -b .addr %patch2 -p1 -b .floc %patch3 -p1 -b .eperm +%patch4 -p1 -b .sigalrm %build %ifarch s390 s390x @@ -160,6 +162,9 @@ mv -f RELNOTES.tmp RELNOTES %attr(644,root,root) %{_mandir}/man8/ninfod.8.gz %changelog +* Fri Apr 11 2014 Jan Synáček - 20121221-10 +- Fix arping hang if SIGALRM is blocked (#1085971) + * Wed Mar 26 2014 Jan Synáček - 20121221-9 - Fix message flood when EPERM is encountered in ping (#1061867)