From f5e1325e6f3d21c74d0692ef666806b383259d3a Mon Sep 17 00:00:00 2001 From: gebidelidaye Date: Mon, 18 May 2020 16:30:44 +0800 Subject: [PATCH] update 0001-iputils-arpings.patch. --- 0001-iputils-arpings.patch | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/0001-iputils-arpings.patch b/0001-iputils-arpings.patch index 54b5542..061b631 100644 --- a/0001-iputils-arpings.patch +++ b/0001-iputils-arpings.patch @@ -1,33 +1,48 @@ From 18f14be80466ddc8fb17a400be82764a779c8dcd Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Wed, 31 Jul 2019 21:28:12 +0100 -Subject: [PATCH] arping: revert partially - fix sent vs received packages - return value +Subject: [PATCH] arping: revert partially +- fix sent vs received packages return value +- fix arping's exit code for -U/A Commit 84ca65ca980315c73f929fed8b6f16bbd698c3a0 caused regression. The arping -D needs return value evaluation that was the earlier default, in other cases the new return value should be correct. -Addresses: https://github.com/iputils/iputils/issues/209 -See-also: https://github.com/void-linux/void-packages/issues/13304 +Addresses1: https://github.com/iputils/iputils/issues/209 +See-also1: https://github.com/void-linux/void-packages/issues/13304 +Addresses2: https://github.com/iputils/iputils/issues/247 +See-also2:https://github.com/iputils/iputils/commit/68f12fc4a0dbef4ae4c404da24040d22c5a14339 Signed-off-by: Sami Kerola --- - arping.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) + arping.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arping.c b/arping.c -index 77c9c56..2c87c15 100644 +index 57114bb..78c8b86 100644 --- a/arping.c +++ b/arping.c -@@ -792,7 +792,11 @@ static int event_loop(struct run_state *ctl) +@@ -797,7 +797,13 @@ static int event_loop(struct run_state *ctl) close(tfd); freeifaddrs(ctl->ifa0); rc |= finish(ctl); - rc |= (ctl->sent != ctl->received); -+ if (ctl->dad && ctl->quit_on_reply) ++ if (ctl->unsolicited) ++ /* nothing */; ++ else if (ctl->dad && ctl->quit_on_reply) + /* Duplicate address detection mode return value */ + rc |= !(ctl->brd_sent != ctl->received); + else + rc |= (ctl->sent != ctl->received); return rc; } + +@@ -942,7 +948,7 @@ int main(int argc, char **argv) + } + memset(&saddr, 0, sizeof(saddr)); + saddr.sin_family = AF_INET; +- if (ctl.source || ctl.gsrc.s_addr) { ++ if (!ctl.unsolicited && (ctl.source || ctl.gsrc.s_addr)) { + saddr.sin_addr = ctl.gsrc; + if (bind(probe_fd, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) + error(2, errno, "bind"); -- Gitee