diff options
Diffstat (limited to 'meta/recipes-extended/iputils/iputils')
6 files changed, 333 insertions, 0 deletions
diff --git a/meta/recipes-extended/iputils/iputils/0001-arping-make-update-neighbours-work-again.patch b/meta/recipes-extended/iputils/iputils/0001-arping-make-update-neighbours-work-again.patch new file mode 100644 index 0000000000..bf86115843 --- /dev/null +++ b/meta/recipes-extended/iputils/iputils/0001-arping-make-update-neighbours-work-again.patch | |||
@@ -0,0 +1,79 @@ | |||
1 | From 86ed08936d49e2c81ef49dfbd02aca1c74d0c098 Mon Sep 17 00:00:00 2001 | ||
2 | From: lac-0073 <61903197+lac-0073@users.noreply.github.com> | ||
3 | Date: Mon, 26 Oct 2020 09:45:42 +0800 | ||
4 | Subject: [PATCH] arpping: make update neighbours work again | ||
5 | |||
6 | The arping is using inconsistent sender_ip_addr and target_ip_addr in | ||
7 | messages. This causes the client receiving the arp message not to update | ||
8 | the arp table entries. | ||
9 | |||
10 | The specific performance is as follows: | ||
11 | |||
12 | There is a machine 2 with IP 10.20.30.3 configured on eth0:0 that is in the | ||
13 | same IP subnet as eth0. This IP was originally used on another machine 1, | ||
14 | and th IP needs to be changed back to the machine 1. When using the arping | ||
15 | command to announce what ethernet address has IP 10.20.30.3, the arp table | ||
16 | on machine 3 is not updated. | ||
17 | |||
18 | Machine 3 original arp table: | ||
19 | |||
20 | 10.20.30.3 machine 2 eth0:0 00:00:00:00:00:02 | ||
21 | 10.20.30.2 machine 2 eth0 00:00:00:00:00:02 | ||
22 | 10.20.30.1 machine 1 eth0 00:00:00:00:00:01 | ||
23 | |||
24 | Create interface eth0:0 on machine 1, and use the arping command to send arp | ||
25 | packets. Expected outcome on machine 3: | ||
26 | |||
27 | 10.20.30.3 machine 1 eth0:0 00:00:00:00:00:01 | ||
28 | 10.20.30.2 machine 2 eth0 00:00:00:00:00:02 | ||
29 | 10.20.30.1 machine 1 eth0 00:00:00:00:00:01 | ||
30 | |||
31 | Actual results on machine 3: | ||
32 | |||
33 | 10.20.30.3 machine 2 eth0:0 00:00:00:00:00:02 | ||
34 | 10.20.30.2 machine 2 eth0 00:00:00:00:00:02 | ||
35 | 10.20.30.1 machine 1 eth0 00:00:00:00:00:01 | ||
36 | |||
37 | Fixes: https://github.com/iputils/iputils/issues/298 | ||
38 | Fixes: 68f12fc4a0dbef4ae4c404da24040d22c5a14339 | ||
39 | Signed-off-by: Aichun Li <liaichun@huawei.com> | ||
40 | Upstream-Status: Backport [https://github.com/iputils/iputils/commit/86ed08936d49e2c81ef49dfbd02aca1c74d0c098] | ||
41 | Signed-off-by: Visa Hankala <visa@hankala.org> | ||
42 | --- | ||
43 | arping.c | 16 +++++++++------- | ||
44 | 1 file changed, 9 insertions(+), 7 deletions(-) | ||
45 | |||
46 | diff --git a/arping.c b/arping.c | ||
47 | index a002786..53fdbb4 100644 | ||
48 | --- a/arping.c | ||
49 | +++ b/arping.c | ||
50 | @@ -968,7 +968,7 @@ int main(int argc, char **argv) | ||
51 | } | ||
52 | memset(&saddr, 0, sizeof(saddr)); | ||
53 | saddr.sin_family = AF_INET; | ||
54 | - if (!ctl.unsolicited && (ctl.source || ctl.gsrc.s_addr)) { | ||
55 | + if (ctl.source || ctl.gsrc.s_addr) { | ||
56 | saddr.sin_addr = ctl.gsrc; | ||
57 | if (bind(probe_fd, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) | ||
58 | error(2, errno, "bind"); | ||
59 | @@ -979,12 +979,14 @@ int main(int argc, char **argv) | ||
60 | saddr.sin_port = htons(1025); | ||
61 | saddr.sin_addr = ctl.gdst; | ||
62 | |||
63 | - if (setsockopt(probe_fd, SOL_SOCKET, SO_DONTROUTE, (char *)&on, sizeof(on)) == -1) | ||
64 | - error(0, errno, _("WARNING: setsockopt(SO_DONTROUTE)")); | ||
65 | - if (connect(probe_fd, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) | ||
66 | - error(2, errno, "connect"); | ||
67 | - if (getsockname(probe_fd, (struct sockaddr *)&saddr, &alen) == -1) | ||
68 | - error(2, errno, "getsockname"); | ||
69 | + if (!ctl.unsolicited) { | ||
70 | + if (setsockopt(probe_fd, SOL_SOCKET, SO_DONTROUTE, (char *)&on, sizeof(on)) == -1) | ||
71 | + error(0, errno, _("WARNING: setsockopt(SO_DONTROUTE)")); | ||
72 | + if (connect(probe_fd, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) | ||
73 | + error(2, errno, "connect"); | ||
74 | + if (getsockname(probe_fd, (struct sockaddr *)&saddr, &alen) == -1) | ||
75 | + error(2, errno, "getsockname"); | ||
76 | + } | ||
77 | ctl.gsrc = saddr.sin_addr; | ||
78 | } | ||
79 | close(probe_fd); | ||
diff --git a/meta/recipes-extended/iputils/iputils/0001-arping-revert-partially-fix-sent-vs-received-package.patch b/meta/recipes-extended/iputils/iputils/0001-arping-revert-partially-fix-sent-vs-received-package.patch new file mode 100644 index 0000000000..8495178879 --- /dev/null +++ b/meta/recipes-extended/iputils/iputils/0001-arping-revert-partially-fix-sent-vs-received-package.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 18f14be80466ddc8fb17a400be82764a779c8dcd Mon Sep 17 00:00:00 2001 | ||
2 | From: Sami Kerola <kerolasa@iki.fi> | ||
3 | Date: Wed, 31 Jul 2019 21:28:12 +0100 | ||
4 | Subject: [PATCH] arping: revert partially - fix sent vs received packages | ||
5 | return value | ||
6 | |||
7 | Commit 84ca65ca980315c73f929fed8b6f16bbd698c3a0 caused regression. The | ||
8 | arping -D needs return value evaluation that was the earlier default, in | ||
9 | other cases the new return value should be correct. | ||
10 | |||
11 | Addresses: https://github.com/iputils/iputils/issues/209 | ||
12 | See-also: https://github.com/void-linux/void-packages/issues/13304 | ||
13 | Signed-off-by: Sami Kerola <kerolasa@iki.fi> | ||
14 | Upstream-Status: Backport [https://github.com/iputils/iputils/commit/18f14be80466ddc8fb17a400be82764a779c8dcd] | ||
15 | Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | ||
16 | --- | ||
17 | arping.c | 6 +++++- | ||
18 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/arping.c b/arping.c | ||
21 | index 77c9c56..2c87c15 100644 | ||
22 | --- a/arping.c | ||
23 | +++ b/arping.c | ||
24 | @@ -792,7 +792,11 @@ static int event_loop(struct run_state *ctl) | ||
25 | close(tfd); | ||
26 | freeifaddrs(ctl->ifa0); | ||
27 | rc |= finish(ctl); | ||
28 | - rc |= (ctl->sent != ctl->received); | ||
29 | + if (ctl->dad && ctl->quit_on_reply) | ||
30 | + /* Duplicate address detection mode return value */ | ||
31 | + rc |= !(ctl->brd_sent != ctl->received); | ||
32 | + else | ||
33 | + rc |= (ctl->sent != ctl->received); | ||
34 | return rc; | ||
35 | } | ||
36 | |||
37 | -- | ||
38 | 2.18.4 | ||
39 | |||
diff --git a/meta/recipes-extended/iputils/iputils/0002-arping-fix-f-quit-on-first-reply-regression.patch b/meta/recipes-extended/iputils/iputils/0002-arping-fix-f-quit-on-first-reply-regression.patch new file mode 100644 index 0000000000..a5f40860dc --- /dev/null +++ b/meta/recipes-extended/iputils/iputils/0002-arping-fix-f-quit-on-first-reply-regression.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 1df5350bdc952b14901fde356b17b78c2bcd4cff Mon Sep 17 00:00:00 2001 | ||
2 | From: Sami Kerola <kerolasa@iki.fi> | ||
3 | Date: Wed, 28 Aug 2019 20:05:22 +0100 | ||
4 | Subject: [PATCH] arping: fix -f quit on first reply regression | ||
5 | |||
6 | When arping runs together with -f 'quit on first reply' and -w <timeout> | ||
7 | 'how long to wait for a reply' the command needs to exit if replies are not | ||
8 | received after wait period. Notice that the exit in case of lost packages | ||
9 | will be 1 signifying failure. Getting a reply results to 0 exit value. | ||
10 | |||
11 | Addresses: https://bugs.debian.org/935946 | ||
12 | Reported-by: Lucas Nussbaum <lucas@debian.org> | ||
13 | Addresses: https://github.com/iputils/iputils/issues/211 | ||
14 | Reported-by: Noah Meyerhans <noahm@debian.org> | ||
15 | Broken-since: 67e070d08dcbec990e1178360f82b3e2ca4f6d5f | ||
16 | Signed-off-by: Sami Kerola <kerolasa@iki.fi> | ||
17 | Upstream-Status: Backport [https://github.com/iputils/iputils/commit/1df5350bdc952b14901fde356b17b78c2bcd4cff] | ||
18 | Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | ||
19 | --- | ||
20 | arping.c | 3 ++- | ||
21 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/arping.c b/arping.c | ||
24 | index 2c87c15..30884f6 100644 | ||
25 | --- a/arping.c | ||
26 | +++ b/arping.c | ||
27 | @@ -764,7 +764,8 @@ static int event_loop(struct run_state *ctl) | ||
28 | continue; | ||
29 | } | ||
30 | total_expires += exp; | ||
31 | - if (0 < ctl->count && (uint64_t)ctl->count < total_expires) { | ||
32 | + if ((0 < ctl->count && (uint64_t)ctl->count < total_expires) || | ||
33 | + (ctl->quit_on_reply && ctl->timeout < total_expires)) { | ||
34 | exit_loop = 1; | ||
35 | continue; | ||
36 | } | ||
37 | -- | ||
38 | 2.18.4 | ||
39 | |||
diff --git a/meta/recipes-extended/iputils/iputils/0003-arping-Fix-comparison-of-different-signedness-warnin.patch b/meta/recipes-extended/iputils/iputils/0003-arping-Fix-comparison-of-different-signedness-warnin.patch new file mode 100644 index 0000000000..ebd122c157 --- /dev/null +++ b/meta/recipes-extended/iputils/iputils/0003-arping-Fix-comparison-of-different-signedness-warnin.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From ec821e572a640bd79aecc3922cb9001f4b6b26f2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Petr Vorel <petr.vorel@gmail.com> | ||
3 | Date: Sat, 7 Sep 2019 06:07:19 +0200 | ||
4 | Subject: [PATCH] arping: Fix comparison of different signedness warning | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | ../arping.c:768:45: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint64_t’ {aka ‘long unsigned int’} [-Wsign-compare] | ||
10 | 768 | (ctl->quit_on_reply && ctl->timeout < total_expires)) { | ||
11 | |||
12 | Fixes: 1df5350 ("arping: fix -f quit on first reply regression") | ||
13 | Reference: https://github.com/iputils/iputils/pull/212 | ||
14 | Acked-by: Sami Kerola <kerolasa@iki.fi> | ||
15 | Signed-off-by: Petr Vorel <petr.vorel@gmail.com> | ||
16 | Upstream-Status: Backport [https://github.com/iputils/iputils/commit/ec821e572a640bd79aecc3922cb9001f4b6b26f2] | ||
17 | Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | ||
18 | --- | ||
19 | arping.c | 2 +- | ||
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/arping.c b/arping.c | ||
23 | index 2d05728..88319cd 100644 | ||
24 | --- a/arping.c | ||
25 | +++ b/arping.c | ||
26 | @@ -765,7 +765,7 @@ static int event_loop(struct run_state *ctl) | ||
27 | } | ||
28 | total_expires += exp; | ||
29 | if ((0 < ctl->count && (uint64_t)ctl->count < total_expires) || | ||
30 | - (ctl->quit_on_reply && ctl->timeout < total_expires)) { | ||
31 | + (ctl->quit_on_reply && ctl->timeout < (long)total_expires)) { | ||
32 | exit_loop = 1; | ||
33 | continue; | ||
34 | } | ||
35 | -- | ||
36 | 2.18.4 | ||
37 | |||
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 | |||
diff --git a/meta/recipes-extended/iputils/iputils/0005-arping-use-additional-timerfd-to-control-when-timeou.patch b/meta/recipes-extended/iputils/iputils/0005-arping-use-additional-timerfd-to-control-when-timeou.patch new file mode 100644 index 0000000000..3b8a8244da --- /dev/null +++ b/meta/recipes-extended/iputils/iputils/0005-arping-use-additional-timerfd-to-control-when-timeou.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | From 60a27c76174c0ae23bdafde2bad4fdd18a44a7ea Mon Sep 17 00:00:00 2001 | ||
2 | From: Sami Kerola <kerolasa@iki.fi> | ||
3 | Date: Sat, 7 Mar 2020 22:03:21 +0000 | ||
4 | Subject: [PATCH] arping: use additional timerfd to control when timeout | ||
5 | happens | ||
6 | |||
7 | Trying to determine timeout by adding up interval values is pointlessly | ||
8 | complicating. With separate timer everything just works. | ||
9 | |||
10 | Addresses: https://github.com/iputils/iputils/issues/259 | ||
11 | Fixes: 1df5350bdc952b14901fde356b17b78c2bcd4cff | ||
12 | Signed-off-by: Sami Kerola <kerolasa@iki.fi> | ||
13 | Upstream-Status: Backport [https://github.com/iputils/iputils/commit/e594ca52afde89746b7d79c875fe9d6aea1850ac] | ||
14 | Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | ||
15 | --- | ||
16 | arping.c | 29 ++++++++++++++++++++++++++--- | ||
17 | 1 file changed, 26 insertions(+), 3 deletions(-) | ||
18 | |||
19 | diff --git a/arping.c b/arping.c | ||
20 | index 61db3a6..7284351 100644 | ||
21 | --- a/arping.c | ||
22 | +++ b/arping.c | ||
23 | @@ -670,6 +670,7 @@ static int event_loop(struct run_state *ctl) | ||
24 | enum { | ||
25 | POLLFD_SIGNAL = 0, | ||
26 | POLLFD_TIMER, | ||
27 | + POLLFD_TIMEOUT, | ||
28 | POLLFD_SOCKET, | ||
29 | POLLFD_COUNT | ||
30 | }; | ||
31 | @@ -686,6 +687,13 @@ static int event_loop(struct run_state *ctl) | ||
32 | .it_value.tv_sec = ctl->interval, | ||
33 | .it_value.tv_nsec = 0 | ||
34 | }; | ||
35 | + int timeoutfd; | ||
36 | + struct itimerspec timeoutfd_vals = { | ||
37 | + .it_interval.tv_sec = ctl->timeout, | ||
38 | + .it_interval.tv_nsec = 0, | ||
39 | + .it_value.tv_sec = ctl->timeout, | ||
40 | + .it_value.tv_nsec = 0 | ||
41 | + }; | ||
42 | uint64_t exp, total_expires = 1; | ||
43 | |||
44 | unsigned char packet[4096]; | ||
45 | @@ -709,7 +717,7 @@ static int event_loop(struct run_state *ctl) | ||
46 | pfds[POLLFD_SIGNAL].fd = sfd; | ||
47 | pfds[POLLFD_SIGNAL].events = POLLIN | POLLERR | POLLHUP; | ||
48 | |||
49 | - /* timerfd */ | ||
50 | + /* interval timerfd */ | ||
51 | tfd = timerfd_create(CLOCK_MONOTONIC, 0); | ||
52 | if (tfd == -1) { | ||
53 | error(0, errno, "timerfd_create failed"); | ||
54 | @@ -722,6 +730,19 @@ static int event_loop(struct run_state *ctl) | ||
55 | pfds[POLLFD_TIMER].fd = tfd; | ||
56 | pfds[POLLFD_TIMER].events = POLLIN | POLLERR | POLLHUP; | ||
57 | |||
58 | + /* timeout timerfd */ | ||
59 | + timeoutfd = timerfd_create(CLOCK_MONOTONIC, 0); | ||
60 | + if (tfd == -1) { | ||
61 | + error(0, errno, "timerfd_create failed"); | ||
62 | + return 1; | ||
63 | + } | ||
64 | + if (timerfd_settime(timeoutfd, 0, &timeoutfd_vals, NULL)) { | ||
65 | + error(0, errno, "timerfd_settime failed"); | ||
66 | + return 1; | ||
67 | + } | ||
68 | + pfds[POLLFD_TIMEOUT].fd = timeoutfd; | ||
69 | + pfds[POLLFD_TIMEOUT].events = POLLIN | POLLERR | POLLHUP; | ||
70 | + | ||
71 | /* socket */ | ||
72 | pfds[POLLFD_SOCKET].fd = ctl->socketfd; | ||
73 | pfds[POLLFD_SOCKET].events = POLLIN | POLLERR | POLLHUP; | ||
74 | @@ -764,13 +785,15 @@ static int event_loop(struct run_state *ctl) | ||
75 | continue; | ||
76 | } | ||
77 | total_expires += exp; | ||
78 | - if ((0 < ctl->count && (uint64_t)ctl->count < total_expires) || | ||
79 | - (ctl->quit_on_reply && ctl->timeout < (long)total_expires)) { | ||
80 | + if (0 < ctl->count && (uint64_t)ctl->count < total_expires) { | ||
81 | exit_loop = 1; | ||
82 | continue; | ||
83 | } | ||
84 | send_pack(ctl); | ||
85 | break; | ||
86 | + case POLLFD_TIMEOUT: | ||
87 | + exit_loop = 1; | ||
88 | + break; | ||
89 | case POLLFD_SOCKET: | ||
90 | if ((s = | ||
91 | recvfrom(ctl->socketfd, packet, sizeof(packet), 0, | ||
92 | -- | ||
93 | 2.18.4 | ||
94 | |||