From: Adam Megacz Date: Mon, 27 Jul 2009 03:32:07 +0000 (-0700) Subject: In rxi_SendPacket[List], down hosts if ENETUNREACH or equivalent X-Git-Tag: openafs-devel-1_5_61~27 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=1ddc7fa920213f9b5455e632bbddf05b866af647;p=packages%2Fo%2Fopenafs.git In rxi_SendPacket[List], down hosts if ENETUNREACH or equivalent This patch causes rxi_SendPacket[List] to "down" a host if rxi_Sendmsg() returns -ENETUNREACH (or equivalent). Previous behavior only did this check if defined(KERNEL) becauase non-defined(KERNEL) implementations did not return meaningful error codes from rxi_Sendmsg(). Jeff Altman supplied the logic for the AFS_NT40_ENV case; I was not able to test this (I do not own a Windows license) and took him on his word. Reviewed-on: http://gerrit.openafs.org/59 Reviewed-by: Adam Megacz Tested-by: Adam Megacz Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 707e3086c..402f78a14 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -2283,10 +2283,10 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn, */ if (call && #ifdef AFS_NT40_ENV - code == -1 && WSAGetLastError() == WSAEHOSTUNREACH -#elif defined(AFS_LINUX20_ENV) && defined(KERNEL) + (code == -1 && WSAGetLastError() == WSAEHOSTUNREACH) || (code == -WSAEHOSTUNREACH) +#elif defined(AFS_LINUX20_ENV) code == -ENETUNREACH -#elif defined(AFS_DARWIN_ENV) && defined(KERNEL) +#elif defined(AFS_DARWIN_ENV) code == EHOSTUNREACH #else 0 @@ -2473,10 +2473,10 @@ rxi_SendPacketList(struct rx_call *call, struct rx_connection *conn, */ if (call && #ifdef AFS_NT40_ENV - code == -1 && WSAGetLastError() == WSAEHOSTUNREACH -#elif defined(AFS_LINUX20_ENV) && defined(KERNEL) + (code == -1 && WSAGetLastError() == WSAEHOSTUNREACH) || (code == -WSAEHOSTUNREACH) +#elif defined(AFS_LINUX20_ENV) code == -ENETUNREACH -#elif defined(AFS_DARWIN_ENV) && defined(KERNEL) +#elif defined(AFS_DARWIN_ENV) code == EHOSTUNREACH #else 0