From dfee0a5879b6a4f82f5a230261c98986bf013573 Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Sun, 26 Jul 2009 20:32:07 -0700 Subject: [PATCH] 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 (cherry picked from commit 1ddc7fa920213f9b5455e632bbddf05b866af647) Change-Id: I1c5bdf8f3216f82f32fcf22f1c47a3a43130e071 Reviewed-on: http://gerrit.openafs.org/945 --- src/rx/rx_packet.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 449b8e240..c6b5247ad 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -2246,10 +2246,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 @@ -2438,10 +2438,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 -- 2.39.5