bpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socket
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first
Changes in v4 from the cover letter
* Add 'sk->sk_type != SOCK_RAW && !ipv6_only_sock(sk)' check.
* Re-implement test with LLM assistance.
* v3: https://lore.kernel.org/all/[email protected]/
Patches in v4 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socketnet/ | +14 | 0 replies | Applied |
| 2/2 | selftests/bpf: Add test to verify the fix for bpf_setsockopt() helpertools/ tools/ | +101 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH bpf-next v4 0/2] bpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socket
When TCP over IPv4 via INET6 API, sk->sk_family is AF_INET6, but it is a v4 pkt. inet_csk(sk)->icsk_af_ops is ipv6_mapped and use ip_queue_xmit. The tos sockopt does not work for bpf [get,set]sockopt() helpers.
Changelog:
v3 -> v4:
* Add 'sk->sk_type != SOCK_RAW && !ipv6_only_sock(sk)' check.
* Re-implement test with LLM assistance.
* v3: https://lore.kernel.org/all/[email protected]/
v2->v3:
* Use sk_is_inet() helper. (Eric Dumazet)
* https://lore.kernel.org/bpf/CANn89i+9GmBLCdgsfH=WWe-tyFYpiO27wONyxaxiU6aOBC6G8g@mail.gmail.com/T/
v1->v2:
* Fix compilation error. (kernel test robot)
* https://lore.kernel.org/bpf/[email protected]/T/
Leon Hwang (2):
bpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socket selftests/bpf: Add test to verify the fix for bpf_setsockopt() helper
net/core/filter.c | 15 +++- .../selftests/bpf/prog_tests/setget_sockopt.c | 78 +++++++++++++++++++ .../selftests/bpf/progs/setget_sockopt.c | 23 ++++++ 3 files changed, 115 insertions(+), 1 deletion(-)
Signature · 1 line
2.54.0