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 <cg2v@andrew.cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-11-24 20:10:49 -05:00
parent f2fdd3040c
commit 8e68e08901

View File

@ -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;