diff options
author | David Howells <dhowells@redhat.com> | 2020-09-16 02:34:39 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2020-11-23 20:53:11 +0100 |
commit | d7d775b1ffb15408a60ec12dc9d02d4751e6b10a (patch) | |
tree | fd5ec2fd330a6857061784d970495ccae899157c /net/rxrpc/insecure.c | |
parent | rxrpc: rxkad: Don't use pskb_pull() to advance through the response packet (diff) | |
download | linux-d7d775b1ffb15408a60ec12dc9d02d4751e6b10a.tar.xz linux-d7d775b1ffb15408a60ec12dc9d02d4751e6b10a.zip |
rxrpc: Ask the security class how much space to allow in a packet
Ask the security class how much header and trailer space to allow for when
allocating a packet, given how much data is remaining.
This will allow the rxgk security class to stick both a trailer in as well
as a header as appropriate in the future.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/insecure.c')
-rw-r--r-- | net/rxrpc/insecure.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/rxrpc/insecure.c b/net/rxrpc/insecure.c index e06725e21c05..9aae99d67833 100644 --- a/net/rxrpc/insecure.c +++ b/net/rxrpc/insecure.c @@ -14,6 +14,17 @@ static int none_init_connection_security(struct rxrpc_connection *conn, return 0; } +/* + * Work out how much data we can put in an unsecured packet. + */ +static int none_how_much_data(struct rxrpc_call *call, size_t remain, + size_t *_buf_size, size_t *_data_size, size_t *_offset) +{ + *_buf_size = *_data_size = min_t(size_t, remain, RXRPC_JUMBO_DATALEN); + *_offset = 0; + return 0; +} + static int none_secure_packet(struct rxrpc_call *call, struct sk_buff *skb, size_t data_size) { @@ -81,6 +92,7 @@ const struct rxrpc_security rxrpc_no_security = { .exit = none_exit, .init_connection_security = none_init_connection_security, .free_call_crypto = none_free_call_crypto, + .how_much_data = none_how_much_data, .secure_packet = none_secure_packet, .verify_packet = none_verify_packet, .locate_data = none_locate_data, |