Skip to content

Commit 8953285

Browse files
jaltmankuba-moo
authored andcommitted
rxrpc: Clients must accept conn from any address
The find connection logic of Transarc's Rx was modified in the mid-1990s to support multi-homed servers which might send a response packet from an address other than the destination address in the received packet. The rules for accepting a packet by an Rx initiator (RX_CLIENT_CONNECTION) were altered to permit acceptance of a packet from any address provided that the port number was unchanged and all of the connection identifiers matched (Epoch, CID, SecurityClass, ...). This change applies the same rules to the Linux implementation which makes it consistent with IBM AFS 3.6, Arla, OpenAFS and AuriStorFS. Fixes: 17926a7 ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") Signed-off-by: Jeffrey Altman <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Marc Dionne <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d091e57 commit 8953285

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

net/rxrpc/conn_object.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,13 @@ struct rxrpc_connection *rxrpc_find_client_connection_rcu(struct rxrpc_local *lo
119119
switch (srx->transport.family) {
120120
case AF_INET:
121121
if (peer->srx.transport.sin.sin_port !=
122-
srx->transport.sin.sin_port ||
123-
peer->srx.transport.sin.sin_addr.s_addr !=
124-
srx->transport.sin.sin_addr.s_addr)
122+
srx->transport.sin.sin_port)
125123
goto not_found;
126124
break;
127125
#ifdef CONFIG_AF_RXRPC_IPV6
128126
case AF_INET6:
129127
if (peer->srx.transport.sin6.sin6_port !=
130-
srx->transport.sin6.sin6_port ||
131-
memcmp(&peer->srx.transport.sin6.sin6_addr,
132-
&srx->transport.sin6.sin6_addr,
133-
sizeof(struct in6_addr)) != 0)
128+
srx->transport.sin6.sin6_port)
134129
goto not_found;
135130
break;
136131
#endif

0 commit comments

Comments
 (0)