diff mbox series

[bpf-next,v7,1/6] bpf: Use ipv6_only_sock in bpf_tcp_gen_syncookie

Message ID 20220428153833.278064-2-maximmi@nvidia.com (mailing list archive)
State Superseded
Delegated to: BPF
Headers show
Series New BPF helpers to accelerate synproxy | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next, async
netdev/apply fail Patch does not apply to bpf-next
bpf/vmtest-bpf-next-PR fail merge-conflict

Commit Message

Maxim Mikityanskiy April 28, 2022, 3:38 p.m. UTC
Instead of querying the sk_ipv6only field directly, use the dedicated
ipv6_only_sock helper.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Lorenz Bauer <lmb@cloudflare.com>
Acked-by: Petar Penkov <ppenkov@google.com>
---
 net/core/filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexei Starovoitov April 29, 2022, 3:15 a.m. UTC | #1
On Thu, Apr 28, 2022 at 8:38 AM Maxim Mikityanskiy <maximmi@nvidia.com> wrote:
>
> Instead of querying the sk_ipv6only field directly, use the dedicated
> ipv6_only_sock helper.
>
> Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
> Acked-by: John Fastabend <john.fastabend@gmail.com>
> Acked-by: Lorenz Bauer <lmb@cloudflare.com>
> Acked-by: Petar Penkov <ppenkov@google.com>
> ---
>  net/core/filter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 8847316ee20e..207a13db5c80 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -7099,7 +7099,7 @@ BPF_CALL_5(bpf_tcp_gen_syncookie, struct sock *, sk, void *, iph, u32, iph_len,
>          */
>         switch (((struct iphdr *)iph)->version) {
>         case 4:
> -               if (sk->sk_family == AF_INET6 && sk->sk_ipv6only)
> +               if (sk->sk_family == AF_INET6 && ipv6_only_sock(sk))
>                         return -EINVAL;

Please rebase patches before resending.

Applying: bpf: Use ipv6_only_sock in bpf_tcp_gen_syncookie
Using index info to reconstruct a base tree...
M    net/core/filter.c
Falling back to patching base and 3-way merge...
Auto-merging net/core/filter.c
No changes -- Patch already applied.
Applying: bpf: Fix documentation of th_len in bpf_tcp_{gen,check}_syncookie
Applying: bpf: Allow helpers to accept pointers with a fixed size
Applying: bpf: Add helpers to issue and check SYN cookies in XDP
error: sha1 information is lacking or useless (include/uapi/linux/bpf.h).
error: could not build fake ancestor
Patch failed at 0004 bpf: Add helpers to issue and check SYN cookies in XDP


Also trim your cc. You keep sending to addresses that are bouncing
(Lorenz's and Petar's).

Remove their Ack-s too or fix them with correct emails.
Maxim Mikityanskiy April 29, 2022, 9:23 a.m. UTC | #2
On 2022-04-29 06:15, Alexei Starovoitov wrote:
> On Thu, Apr 28, 2022 at 8:38 AM Maxim Mikityanskiy <maximmi@nvidia.com> wrote:
>>
>> Instead of querying the sk_ipv6only field directly, use the dedicated
>> ipv6_only_sock helper.
>>
>> Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
>> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
>> Acked-by: John Fastabend <john.fastabend@gmail.com>
>> Acked-by: Lorenz Bauer <lmb@cloudflare.com>
>> Acked-by: Petar Penkov <ppenkov@google.com>
>> ---
>>   net/core/filter.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/core/filter.c b/net/core/filter.c
>> index 8847316ee20e..207a13db5c80 100644
>> --- a/net/core/filter.c
>> +++ b/net/core/filter.c
>> @@ -7099,7 +7099,7 @@ BPF_CALL_5(bpf_tcp_gen_syncookie, struct sock *, sk, void *, iph, u32, iph_len,
>>           */
>>          switch (((struct iphdr *)iph)->version) {
>>          case 4:
>> -               if (sk->sk_family == AF_INET6 && sk->sk_ipv6only)
>> +               if (sk->sk_family == AF_INET6 && ipv6_only_sock(sk))
>>                          return -EINVAL;
> 
> Please rebase patches before resending.

I'm sorry - it's totally my fault! I didn't fetch before rebasing =/

> Applying: bpf: Use ipv6_only_sock in bpf_tcp_gen_syncookie
> Using index info to reconstruct a base tree...
> M    net/core/filter.c
> Falling back to patching base and 3-way merge...
> Auto-merging net/core/filter.c
> No changes -- Patch already applied.

Someone else has made the same change as my first patch, so I'll drop it.

> Applying: bpf: Fix documentation of th_len in bpf_tcp_{gen,check}_syncookie
> Applying: bpf: Allow helpers to accept pointers with a fixed size
> Applying: bpf: Add helpers to issue and check SYN cookies in XDP
> error: sha1 information is lacking or useless (include/uapi/linux/bpf.h).
> error: could not build fake ancestor
> Patch failed at 0004 bpf: Add helpers to issue and check SYN cookies in XDP
> 
> 
> Also trim your cc. You keep sending to addresses that are bouncing
> (Lorenz's and Petar's).
> 
> Remove their Ack-s too or fix them with correct emails.

As we don't need patch 1 anymore, I will drop it, and we won't have 
these acks anymore. I'll also exclude these people from CC (I only kept 
them because of their acks they gave when their emails still worked).
diff mbox series

Patch

diff --git a/net/core/filter.c b/net/core/filter.c
index 8847316ee20e..207a13db5c80 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7099,7 +7099,7 @@  BPF_CALL_5(bpf_tcp_gen_syncookie, struct sock *, sk, void *, iph, u32, iph_len,
 	 */
 	switch (((struct iphdr *)iph)->version) {
 	case 4:
-		if (sk->sk_family == AF_INET6 && sk->sk_ipv6only)
+		if (sk->sk_family == AF_INET6 && ipv6_only_sock(sk))
 			return -EINVAL;
 
 		mss = tcp_v4_get_syncookie(sk, iph, th, &cookie);