diff options
Diffstat (limited to 'meta/recipes-extended/iputils/iputils/0004-arping-return-success-when-unsolicited-ARP-mode-dest.patch')
-rw-r--r-- | meta/recipes-extended/iputils/iputils/0004-arping-return-success-when-unsolicited-ARP-mode-dest.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-extended/iputils/iputils/0004-arping-return-success-when-unsolicited-ARP-mode-dest.patch b/meta/recipes-extended/iputils/iputils/0004-arping-return-success-when-unsolicited-ARP-mode-dest.patch new file mode 100644 index 0000000000..923e06e30b --- /dev/null +++ b/meta/recipes-extended/iputils/iputils/0004-arping-return-success-when-unsolicited-ARP-mode-dest.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 68f12fc4a0dbef4ae4c404da24040d22c5a14339 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sami Kerola <kerolasa@iki.fi> | ||
3 | Date: Sat, 8 Feb 2020 14:12:18 +0000 | ||
4 | Subject: [PATCH] arping: return success when unsolicited ARP mode destination | ||
5 | does not answer | ||
6 | |||
7 | Manual page is making promise answers are not expected when -U (or -A) | ||
8 | option is in use. Either I am looking wrong or this has been broken since | ||
9 | at the beginning of git history. | ||
10 | |||
11 | Addresses: https://github.com/iputils/iputils/issues/247 | ||
12 | Signed-off-by: Sami Kerola <kerolasa@iki.fi> | ||
13 | Upstream-Status: Backport [https://github.com/iputils/iputils/commit/68f12fc4a0dbef4ae4c404da24040d22c5a14339] | ||
14 | Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | ||
15 | --- | ||
16 | arping.c | 6 ++++-- | ||
17 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/arping.c b/arping.c | ||
20 | index 996cf2b..5180ae0 100644 | ||
21 | --- a/arping.c | ||
22 | +++ b/arping.c | ||
23 | @@ -794,7 +794,9 @@ static int event_loop(struct run_state *ctl) | ||
24 | close(tfd); | ||
25 | freeifaddrs(ctl->ifa0); | ||
26 | rc |= finish(ctl); | ||
27 | - if (ctl->dad && ctl->quit_on_reply) | ||
28 | + if (ctl->unsolicited) | ||
29 | + /* nothing */; | ||
30 | + else if (ctl->dad && ctl->quit_on_reply) | ||
31 | /* Duplicate address detection mode return value */ | ||
32 | rc |= !(ctl->brd_sent != ctl->received); | ||
33 | else | ||
34 | @@ -943,7 +945,7 @@ int main(int argc, char **argv) | ||
35 | } | ||
36 | memset(&saddr, 0, sizeof(saddr)); | ||
37 | saddr.sin_family = AF_INET; | ||
38 | - if (ctl.source || ctl.gsrc.s_addr) { | ||
39 | + if (!ctl.unsolicited && (ctl.source || ctl.gsrc.s_addr)) { | ||
40 | saddr.sin_addr = ctl.gsrc; | ||
41 | if (bind(probe_fd, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) | ||
42 | error(2, errno, "bind"); | ||
43 | -- | ||
44 | 2.18.4 | ||
45 | |||