Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] iputils: backport patch to fix arping hang problem
@ 2017-09-07  2:37 Chen Qi
  2017-09-07  2:37 ` [PATCH 1/1] " Chen Qi
  2017-09-11  1:45 ` [PATCH 0/1] " ChenQi
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Qi @ 2017-09-07  2:37 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 8b4f16a9cbbaf521461f699b7264fac2ac872581:

  mesa-gl: Fix build after recent mesa PACKAGECONFIG changes (2017-09-05 15:01:02 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/iputils-hang
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/iputils-hang

Chen Qi (1):
  iputils: backport patch to fix arping hang problem

 ...ing-fix-arping-hang-if-SIGALRM-is-blocked.patch | 44 ++++++++++++++++++++++
 meta/recipes-extended/iputils/iputils_s20151218.bb |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch

-- 
1.9.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] iputils: backport patch to fix arping hang problem
  2017-09-07  2:37 [PATCH 0/1] iputils: backport patch to fix arping hang problem Chen Qi
@ 2017-09-07  2:37 ` Chen Qi
  2017-09-11  1:45 ` [PATCH 0/1] " ChenQi
  1 sibling, 0 replies; 3+ messages in thread
From: Chen Qi @ 2017-09-07  2:37 UTC (permalink / raw)
  To: openembedded-core

arping hangs if SIGALARM is blocked. Backport a patch to fix this problem.

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.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 ...ing-fix-arping-hang-if-SIGALRM-is-blocked.patch | 44 ++++++++++++++++++++++
 meta/recipes-extended/iputils/iputils_s20151218.bb |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch

diff --git a/meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch b/meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch
new file mode 100644
index 0000000..7b56276
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch
@@ -0,0 +1,44 @@
+arping: fix arping hang if SIGALRM is blocked
+
+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.
+
+Upstream-Status: Backport
+
+Reported-by: Rui Prior <rprior@dcc.fc.up.pt>
+RH-Bugzilla: #1085971
+Signed-off-by: Jan Synacek <jsynacek@redhat.com>
+Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
+
+diff --git a/arping.c.orig b/arping.c
+index 35408c1..2098159 100644
+--- a/arping.c.orig
++++ b/arping.c
+@@ -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/meta/recipes-extended/iputils/iputils_s20151218.bb b/meta/recipes-extended/iputils/iputils_s20151218.bb
index 0d4dd1b..46de6fc 100644
--- a/meta/recipes-extended/iputils/iputils_s20151218.bb
+++ b/meta/recipes-extended/iputils/iputils_s20151218.bb
@@ -20,6 +20,7 @@ SRC_URI = "http://www.skbuff.net/iputils/${BPN}-${PV}.tar.bz2 \
            file://nsgmls-path-fix.patch \
            file://0001-Fix-header-inclusion-for-musl.patch \
            file://0001-Intialize-struct-elements-by-name.patch \
+           file://arping-fix-arping-hang-if-SIGALRM-is-blocked.patch \
           "
 
 SRC_URI[md5sum] = "8aaa7395f27dff9f57ae016d4bc753ce"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] iputils: backport patch to fix arping hang problem
  2017-09-07  2:37 [PATCH 0/1] iputils: backport patch to fix arping hang problem Chen Qi
  2017-09-07  2:37 ` [PATCH 1/1] " Chen Qi
@ 2017-09-11  1:45 ` ChenQi
  1 sibling, 0 replies; 3+ messages in thread
From: ChenQi @ 2017-09-11  1:45 UTC (permalink / raw)
  To: openembedded-core

ping

On 09/07/2017 10:37 AM, Chen Qi wrote:
> The following changes since commit 8b4f16a9cbbaf521461f699b7264fac2ac872581:
>
>    mesa-gl: Fix build after recent mesa PACKAGECONFIG changes (2017-09-05 15:01:02 +0100)
>
> are available in the git repository at:
>
>    git://git.pokylinux.org/poky-contrib ChenQi/iputils-hang
>    http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/iputils-hang
>
> Chen Qi (1):
>    iputils: backport patch to fix arping hang problem
>
>   ...ing-fix-arping-hang-if-SIGALRM-is-blocked.patch | 44 ++++++++++++++++++++++
>   meta/recipes-extended/iputils/iputils_s20151218.bb |  1 +
>   2 files changed, 45 insertions(+)
>   create mode 100644 meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-11  1:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-07  2:37 [PATCH 0/1] iputils: backport patch to fix arping hang problem Chen Qi
2017-09-07  2:37 ` [PATCH 1/1] " Chen Qi
2017-09-11  1:45 ` [PATCH 0/1] " ChenQi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox