Re: [External] Re: [PATCH bpf-next v3 1/2] bpf: Fix bpf_get/setsockopt to tos not take effect when TCP over IPv4 via INET6 API

2024-10-16 Thread Feng Zhou
在 2024/10/1 10:27, Martin KaFai Lau 写道: On 9/14/24 3:32 AM, Feng zhou wrote: From: Feng Zhou when TCP over IPv4 via INET6 API, bpf_get/setsockopt with ipv4 will I think you meant bpf_get/setsockopt with SOL_IP will fail. so s/ipv4/SOL_IP/? fail, because sk->sk_family is AF_INET6. With ip

Re: [PATCH bpf-next v3 1/2] bpf: Fix bpf_get/setsockopt to tos not take effect when TCP over IPv4 via INET6 API

2024-09-30 Thread Martin KaFai Lau
On 9/14/24 3:32 AM, Feng zhou wrote: From: Feng Zhou when TCP over IPv4 via INET6 API, bpf_get/setsockopt with ipv4 will I think you meant bpf_get/setsockopt with SOL_IP will fail. so s/ipv4/SOL_IP/? fail, because sk->sk_family is AF_INET6. With ipv6 will success, not take effect, because i

Re: [PATCH bpf-next v3 1/2] bpf: Fix bpf_get/setsockopt to tos not take effect when TCP over IPv4 via INET6 API

2024-09-14 Thread Eric Dumazet
On Sat, Sep 14, 2024 at 12:32 PM Feng zhou wrote: > > From: Feng Zhou > > when TCP over IPv4 via INET6 API, bpf_get/setsockopt with ipv4 will > fail, because sk->sk_family is AF_INET6. With ipv6 will success, not > take effect, because inet_csk(sk)->icsk_af_ops is ipv6_mapped and > use ip_queue_x

[PATCH bpf-next v3 1/2] bpf: Fix bpf_get/setsockopt to tos not take effect when TCP over IPv4 via INET6 API

2024-09-14 Thread Feng zhou
From: Feng Zhou when TCP over IPv4 via INET6 API, bpf_get/setsockopt with ipv4 will fail, because sk->sk_family is AF_INET6. With ipv6 will success, not take effect, because inet_csk(sk)->icsk_af_ops is ipv6_mapped and use ip_queue_xmit, inet_sk(sk)->tos. Bpf_get/setsockopt use sk_is_inet() help