@@ -57,7 +57,7 @@ int crypto_encrypt(struct __sk_buff *skb)
57
57
{
58
58
struct __crypto_ctx_value * v ;
59
59
struct bpf_crypto_ctx * ctx ;
60
- struct bpf_dynptr psrc , pdst , iv ;
60
+ struct bpf_dynptr psrc , pdst ;
61
61
62
62
v = crypto_ctx_value_lookup ();
63
63
if (!v ) {
@@ -73,9 +73,8 @@ int crypto_encrypt(struct __sk_buff *skb)
73
73
74
74
bpf_dynptr_from_skb (skb , 0 , & psrc );
75
75
bpf_dynptr_from_mem (dst , len , 0 , & pdst );
76
- bpf_dynptr_from_mem (dst , 0 , 0 , & iv );
77
76
78
- status = bpf_crypto_encrypt (ctx , & psrc , & pdst , & iv );
77
+ status = bpf_crypto_encrypt (ctx , & psrc , & pdst , NULL );
79
78
__sync_add_and_fetch (& hits , 1 );
80
79
81
80
return 0 ;
@@ -84,7 +83,7 @@ int crypto_encrypt(struct __sk_buff *skb)
84
83
SEC ("tc" )
85
84
int crypto_decrypt (struct __sk_buff * skb )
86
85
{
87
- struct bpf_dynptr psrc , pdst , iv ;
86
+ struct bpf_dynptr psrc , pdst ;
88
87
struct __crypto_ctx_value * v ;
89
88
struct bpf_crypto_ctx * ctx ;
90
89
@@ -98,9 +97,8 @@ int crypto_decrypt(struct __sk_buff *skb)
98
97
99
98
bpf_dynptr_from_skb (skb , 0 , & psrc );
100
99
bpf_dynptr_from_mem (dst , len , 0 , & pdst );
101
- bpf_dynptr_from_mem (dst , 0 , 0 , & iv );
102
100
103
- status = bpf_crypto_decrypt (ctx , & psrc , & pdst , & iv );
101
+ status = bpf_crypto_decrypt (ctx , & psrc , & pdst , NULL );
104
102
__sync_add_and_fetch (& hits , 1 );
105
103
106
104
return 0 ;
0 commit comments