rxrpc: Fix checks as to whether we should set up a new call

There's a check in rxrpc_data_ready() that's checking the CLIENT_INITIATED
flag in the packet type field rather than in the packet flags field.

Fix this by creating a pair of helper functions to check whether the packet
is going to the client or to the server and use them generally.

Fixes: 248f219cb8 ("rxrpc: Rewrite the data and ack handling code")
Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
David Howells
2018-09-27 15:13:08 +01:00
parent 092ffc51fb
commit dc71db34e4
3 changed files with 15 additions and 9 deletions

View File

@@ -463,6 +463,16 @@ struct rxrpc_connection {
u8 out_clientflag; /* RXRPC_CLIENT_INITIATED if we are client */
};
static inline bool rxrpc_to_server(const struct rxrpc_skb_priv *sp)
{
return sp->hdr.flags & RXRPC_CLIENT_INITIATED;
}
static inline bool rxrpc_to_client(const struct rxrpc_skb_priv *sp)
{
return !rxrpc_to_server(sp);
}
/*
* Flags in call->flags.
*/