From 8e68e08901b0ad003ad1e5114a155bfac83bdd83 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 24 Nov 2012 20:10:49 -0500 Subject: [PATCH] rx: set abort client_initiated flag to match direction In a recent incident involving packet reflection back to the file server, aborts were being sent by the file server in response to a server sent packet. The aborts sent in response also failed to set the CLIENT_INITIATED flag in the header which permitted the the actual client to confuse the Abort as applying to its client initiated connection. in rxi_SendRawAbort, set the CLIENT_INITIATED flag to the opposite of the packet the abort is being sent in response to. Thanks to Chaskiel Grundman for the suggestion. Change-Id: Iea4189f022ac050e2e005e80c427f1c02c2251db Reviewed-on: http://gerrit.openafs.org/8513 Reviewed-by: Chaskiel Grundman Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- src/rx/rx_packet.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 15b0e1606b..68d6593096 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -2544,6 +2544,14 @@ rxi_SendRawAbort(osi_socket socket, afs_uint32 host, u_short port, theader.securityIndex = source->header.securityIndex; theader.cid = htonl(source->header.cid); + /* + * If the abort is being sent in response to a server initiated packet, + * set client_initiated in the abort to ensure it is not associated by + * the receiver with a connection in the opposite direction. + */ + if ((source->header.flags & RX_CLIENT_INITIATED) != RX_CLIENT_INITIATED) + theader.flags |= RX_CLIENT_INITIATED; + error = htonl(error); iov[0].iov_base = &theader;