diff options
Diffstat (limited to 'meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch')
| -rw-r--r-- | meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch | 44 |
1 files changed, 0 insertions, 44 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 deleted file mode 100644 index 7b56276b39..0000000000 --- a/meta/recipes-extended/iputils/files/arping-fix-arping-hang-if-SIGALRM-is-blocked.patch +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 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 | } | ||
