diff options
Diffstat (limited to 'meta/recipes-extended/iputils')
-rw-r--r-- | meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch | 44 | ||||
-rw-r--r-- | meta/recipes-extended/iputils/iputils_s20151218.bb | 1 |
2 files changed, 45 insertions, 0 deletions
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 0000000000..7b56276b39 --- /dev/null +++ b/meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | arping: fix arping hang if SIGALRM is blocked | ||
2 | |||
3 | Unblock SIGALRM so that the previously called alarm() can prevent | ||
4 | recvfrom() from blocking forever in case the inherited procmask is | ||
5 | blocking SIGALRM and no packet is received. | ||
6 | |||
7 | Upstream-Status: Backport | ||
8 | |||
9 | Reported-by: Rui Prior <rprior@dcc.fc.up.pt> | ||
10 | RH-Bugzilla: #1085971 | ||
11 | Signed-off-by: Jan Synacek <jsynacek@redhat.com> | ||
12 | Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com> | ||
13 | |||
14 | diff --git a/arping.c.orig b/arping.c | ||
15 | index 35408c1..2098159 100644 | ||
16 | --- a/arping.c.orig | ||
17 | +++ b/arping.c | ||
18 | @@ -1215,16 +1215,22 @@ main(int argc, char **argv) | ||
19 | socklen_t alen = sizeof(from); | ||
20 | int cc; | ||
21 | |||
22 | + sigemptyset(&sset); | ||
23 | + sigaddset(&sset, SIGALRM); | ||
24 | + sigaddset(&sset, SIGINT); | ||
25 | + /* Unblock SIGALRM so that the previously called alarm() | ||
26 | + * can prevent recvfrom from blocking forever in case the | ||
27 | + * inherited procmask is blocking SIGALRM and no packet | ||
28 | + * is received. */ | ||
29 | + sigprocmask(SIG_UNBLOCK, &sset, &osset); | ||
30 | + | ||
31 | if ((cc = recvfrom(s, packet, sizeof(packet), 0, | ||
32 | (struct sockaddr *)&from, &alen)) < 0) { | ||
33 | perror("arping: recvfrom"); | ||
34 | continue; | ||
35 | } | ||
36 | |||
37 | - sigemptyset(&sset); | ||
38 | - sigaddset(&sset, SIGALRM); | ||
39 | - sigaddset(&sset, SIGINT); | ||
40 | - sigprocmask(SIG_BLOCK, &sset, &osset); | ||
41 | + sigprocmask(SIG_BLOCK, &sset, NULL); | ||
42 | recv_pack(packet, cc, (struct sockaddr_ll *)&from); | ||
43 | sigprocmask(SIG_SETMASK, &osset, NULL); | ||
44 | } | ||
diff --git a/meta/recipes-extended/iputils/iputils_s20151218.bb b/meta/recipes-extended/iputils/iputils_s20151218.bb index 0d4dd1b17c..46de6fc444 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 \ | |||
20 | file://nsgmls-path-fix.patch \ | 20 | file://nsgmls-path-fix.patch \ |
21 | file://0001-Fix-header-inclusion-for-musl.patch \ | 21 | file://0001-Fix-header-inclusion-for-musl.patch \ |
22 | file://0001-Intialize-struct-elements-by-name.patch \ | 22 | file://0001-Intialize-struct-elements-by-name.patch \ |
23 | file://arping-fix-arping-hang-if-SIGALRM-is-blocked.patch \ | ||
23 | " | 24 | " |
24 | 25 | ||
25 | SRC_URI[md5sum] = "8aaa7395f27dff9f57ae016d4bc753ce" | 26 | SRC_URI[md5sum] = "8aaa7395f27dff9f57ae016d4bc753ce" |