Skip to content

Commit

Permalink
net/tls: Constify base proto ops used for building tls proto
Browse files Browse the repository at this point in the history
The helper that builds kTLS proto ops doesn't need to and should not modify
the base proto ops. Annotate the parameter as read-only.

Signed-off-by: Jakub Sitnicki <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jsitnicki authored and davem330 committed Mar 22, 2020
1 parent 26922c0 commit f13fe3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/tls/tls_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static DEFINE_MUTEX(tcpv4_prot_mutex);
static struct proto tls_prots[TLS_NUM_PROTS][TLS_NUM_CONFIG][TLS_NUM_CONFIG];
static struct proto_ops tls_sw_proto_ops;
static void build_protos(struct proto prot[TLS_NUM_CONFIG][TLS_NUM_CONFIG],
struct proto *base);
const struct proto *base);

void update_sk_prot(struct sock *sk, struct tls_context *ctx)
{
Expand Down Expand Up @@ -652,7 +652,7 @@ static void tls_build_proto(struct sock *sk)
}

static void build_protos(struct proto prot[TLS_NUM_CONFIG][TLS_NUM_CONFIG],
struct proto *base)
const struct proto *base)
{
prot[TLS_BASE][TLS_BASE] = *base;
prot[TLS_BASE][TLS_BASE].setsockopt = tls_setsockopt;
Expand Down

0 comments on commit f13fe3e

Please sign in to comment.