]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
rx: RX_INVALID_OPERATION abort unknown service only
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 25 Nov 2012 00:47:01 +0000 (19:47 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 6 Dec 2012 18:16:29 +0000 (10:16 -0800)
Patchset 1fbe83f9aacfc36a9c426ba1fd18ad7c72869dc1 introduced the
sending of RX_INVALID_OPERATION aborts for connection attempts
requesting a service not offered by the rx peer.  By sending aborts
for all failures of rxi_FindConnection() the set of incoming packets
that are responded to is broader than simply those with non-matching
serviceIds.  This patchset restricts the transmission of
RX_INVALID_OPERATION aborts only to the explicit case in which
rxi_FindConnection() attempted to find a service and either failed
to find a match or couldn't apply the requested security class/level
to that service.

Reviewed-on: http://gerrit.openafs.org/8512
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 81212b18b3411b538c4a1bb94732948902005beb)

Change-Id: Ic732c013d6f77df991e97de7f1c5af88a194e81c
Reviewed-on: http://gerrit.openafs.org/8608
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/rx/rx.c
src/rx/rx_prototypes.h

index 4ac971678113f1796a4437d1a3f2e22d0af5305a..7982c77942825a7aec88f9ad41bc5f01066c4617 100644 (file)
@@ -2910,10 +2910,12 @@ rxi_FindPeer(afs_uint32 host, u_short port,
 struct rx_connection *
 rxi_FindConnection(osi_socket socket, afs_uint32 host,
                   u_short port, u_short serviceId, afs_uint32 cid,
-                  afs_uint32 epoch, int type, u_int securityIndex)
+                  afs_uint32 epoch, int type, u_int securityIndex,
+                  int *unknownService)
 {
     int hashindex, flag, i;
     struct rx_connection *conn;
+    *unknownService = 0;
     hashindex = CONN_HASH(host, port, cid, epoch, type);
     MUTEX_ENTER(&rx_connHashTable_lock);
     rxLastConn ? (conn = rxLastConn, flag = 0) : (conn =
@@ -2957,6 +2959,7 @@ rxi_FindConnection(osi_socket socket, afs_uint32 host,
        service = rxi_FindService(socket, serviceId);
        if (!service || (securityIndex >= service->nSecurityObjects)
            || (service->securityObjects[securityIndex] == 0)) {
+           *unknownService = 1;
            MUTEX_EXIT(&rx_connHashTable_lock);
            return (struct rx_connection *)0;
        }
@@ -3114,6 +3117,7 @@ rxi_ReceivePacket(struct rx_packet *np, osi_socket socket,
     afs_uint32 currentCallNumber;
     int type;
     int skew;
+    int unknownService = 0;
 #ifdef RXDEBUG
     char *packetType;
 #endif
@@ -3169,12 +3173,13 @@ rxi_ReceivePacket(struct rx_packet *np, osi_socket socket,
     conn =
        rxi_FindConnection(socket, host, port, np->header.serviceId,
                           np->header.cid, np->header.epoch, type,
-                          np->header.securityIndex);
+                          np->header.securityIndex,
+                          &unknownService);
 
     /* To avoid having 2 connections just abort at each other,
        don't abort an abort. */
     if (!conn) {
-        if (np->header.type != RX_PACKET_TYPE_ABORT)
+        if (unknownService && (np->header.type != RX_PACKET_TYPE_ABORT))
             rxi_SendRawAbort(socket, host, port, RX_INVALID_OPERATION,
                              np, 0);
         return np;
index d433dfeecad662b8bff227c97520c68c22eee271..0a9a389a678c59bfd3e9edf5d5fc3caff9daf1be 100644 (file)
@@ -111,7 +111,8 @@ extern struct rx_connection *rxi_FindConnection(osi_socket socket,
                                                u_short serviceId,
                                                afs_uint32 cid,
                                                afs_uint32 epoch, int type,
-                                               u_int securityIndex);
+                                               u_int securityIndex,
+                                               int *unknownService);
 extern struct rx_packet *rxi_ReceivePacket(struct rx_packet *np,
                                           osi_socket socket, afs_uint32 host,
                                           u_short port, int *tnop,