freebsd-ports/net-mgmt/scotty3/files/patch-unix:nmicmpd.c
Mark Linimon d55e243de2 If you attempt to send an ICMP echo to a host on the same ethernet
subnet, and that host is down/turned off, the Tnm::icmp echo command
will fail rather than return an unreachable indication on some
occasions.  This is because the nmicmpd program will occasionally
get an EHOSTDOWN error when doing a sendto() when the ARP entry
resolution times out.

This is a problem since this API can support a list of hosts to
send traffic to, and a single error as described will abort the
entire operation.

(The reviewer claims that he could not duplicate the problem,
but that the patch seems like a good idea anyway.)
PR:		ports/24940
Submitted by:	Louis Mamakos <louie@transsys.com>
Reviewed by:	Stefan Eßer <se@FreeBSD.org>
2004-02-13 09:31:58 +00:00

17 lines
496 B
C

--- nmicmpd.c.orig Tue Feb 6 15:34:03 2001
+++ nmicmpd.c Tue Feb 6 15:44:53 2001
@@ -924,6 +924,14 @@
if (rc != size) {
if (rc < 0) {
+ /*
+ * If we get an EHOSTDOWN error, this probably means that
+ * the the pending ARP entry has timed out for the host.
+ * Just ignore the error, and attempt a normal retry.
+ */
+ if (errno == EHOSTDOWN)
+ return 0;
+
PosixError("sendto failed");
}
job->status = ICMP_STATUS_GENERROR;