summaryrefslogtreecommitdiffstats
path: root/net/tls
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2018-03-18 12:57:05 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2018-03-19 21:14:38 +0100
commit8c05dbf04b2882c3c0bc43fe7668c720210877f3 (patch)
treeb13d4d3116498ab38c1493cdeb21254313c2f94d /net/tls
parent312fc2b4c82e96a48cb2d0da2bd4816eb253c499 (diff)
downloadop-kernel-dev-8c05dbf04b2882c3c0bc43fe7668c720210877f3.zip
op-kernel-dev-8c05dbf04b2882c3c0bc43fe7668c720210877f3.tar.gz
net: generalize sk_alloc_sg to work with scatterlist rings
The current implementation of sk_alloc_sg expects scatterlist to always start at entry 0 and complete at entry MAX_SKB_FRAGS. Future patches will want to support starting at arbitrary offset into scatterlist so add an additional sg_start parameters and then default to the current values in TLS code paths. Signed-off-by: John Fastabend <john.fastabend@gmail.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_sw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 0fc8a24..057a558 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -94,7 +94,7 @@ static int alloc_encrypted_sg(struct sock *sk, int len)
int rc = 0;
rc = sk_alloc_sg(sk, len,
- ctx->sg_encrypted_data,
+ ctx->sg_encrypted_data, 0,
&ctx->sg_encrypted_num_elem,
&ctx->sg_encrypted_size, 0);
@@ -107,7 +107,7 @@ static int alloc_plaintext_sg(struct sock *sk, int len)
struct tls_sw_context *ctx = tls_sw_ctx(tls_ctx);
int rc = 0;
- rc = sk_alloc_sg(sk, len, ctx->sg_plaintext_data,
+ rc = sk_alloc_sg(sk, len, ctx->sg_plaintext_data, 0,
&ctx->sg_plaintext_num_elem, &ctx->sg_plaintext_size,
tls_ctx->pending_open_record_frags);
OpenPOWER on IntegriCloud