52
52
};
53
53
54
54
enum {
55
- TLS_BASE_TX ,
55
+ TLS_BASE ,
56
56
TLS_SW_TX ,
57
57
TLS_NUM_CONFIG ,
58
58
};
@@ -65,7 +65,7 @@ static inline void update_sk_prot(struct sock *sk, struct tls_context *ctx)
65
65
{
66
66
int ip_ver = sk -> sk_family == AF_INET6 ? TLSV6 : TLSV4 ;
67
67
68
- sk -> sk_prot = & tls_prots [ip_ver ][ctx -> tx_conf ];
68
+ sk -> sk_prot = & tls_prots [ip_ver ][ctx -> conf ];
69
69
}
70
70
71
71
int wait_on_pending_writer (struct sock * sk , long * timeo )
@@ -238,7 +238,7 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)
238
238
lock_sock (sk );
239
239
sk_proto_close = ctx -> sk_proto_close ;
240
240
241
- if (ctx -> tx_conf == TLS_BASE_TX ) {
241
+ if (ctx -> conf == TLS_BASE ) {
242
242
kfree (ctx );
243
243
goto skip_tx_cleanup ;
244
244
}
@@ -262,7 +262,7 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)
262
262
kfree (ctx -> tx .rec_seq );
263
263
kfree (ctx -> tx .iv );
264
264
265
- if (ctx -> tx_conf == TLS_SW_TX )
265
+ if (ctx -> conf == TLS_SW_TX )
266
266
tls_sw_free_tx_resources (sk );
267
267
268
268
skip_tx_cleanup :
@@ -371,7 +371,7 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval,
371
371
struct tls_crypto_info * crypto_info ;
372
372
struct tls_context * ctx = tls_get_ctx (sk );
373
373
int rc = 0 ;
374
- int tx_conf ;
374
+ int conf ;
375
375
376
376
if (!optval || (optlen < sizeof (* crypto_info ))) {
377
377
rc = - EINVAL ;
@@ -418,11 +418,11 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval,
418
418
419
419
/* currently SW is default, we will have ethtool in future */
420
420
rc = tls_set_sw_offload (sk , ctx );
421
- tx_conf = TLS_SW_TX ;
421
+ conf = TLS_SW_TX ;
422
422
if (rc )
423
423
goto err_crypto_info ;
424
424
425
- ctx -> tx_conf = tx_conf ;
425
+ ctx -> conf = conf ;
426
426
update_sk_prot (sk , ctx );
427
427
ctx -> sk_write_space = sk -> sk_write_space ;
428
428
sk -> sk_write_space = tls_write_space ;
@@ -465,12 +465,12 @@ static int tls_setsockopt(struct sock *sk, int level, int optname,
465
465
466
466
static void build_protos (struct proto * prot , struct proto * base )
467
467
{
468
- prot [TLS_BASE_TX ] = * base ;
469
- prot [TLS_BASE_TX ].setsockopt = tls_setsockopt ;
470
- prot [TLS_BASE_TX ].getsockopt = tls_getsockopt ;
471
- prot [TLS_BASE_TX ].close = tls_sk_proto_close ;
468
+ prot [TLS_BASE ] = * base ;
469
+ prot [TLS_BASE ].setsockopt = tls_setsockopt ;
470
+ prot [TLS_BASE ].getsockopt = tls_getsockopt ;
471
+ prot [TLS_BASE ].close = tls_sk_proto_close ;
472
472
473
- prot [TLS_SW_TX ] = prot [TLS_BASE_TX ];
473
+ prot [TLS_SW_TX ] = prot [TLS_BASE ];
474
474
prot [TLS_SW_TX ].sendmsg = tls_sw_sendmsg ;
475
475
prot [TLS_SW_TX ].sendpage = tls_sw_sendpage ;
476
476
}
@@ -513,7 +513,7 @@ static int tls_init(struct sock *sk)
513
513
mutex_unlock (& tcpv6_prot_mutex );
514
514
}
515
515
516
- ctx -> tx_conf = TLS_BASE_TX ;
516
+ ctx -> conf = TLS_BASE ;
517
517
update_sk_prot (sk , ctx );
518
518
out :
519
519
return rc ;
0 commit comments