# Re: \[PATCH v1 net-next 2/4\] selftests: bpf: sockmap: Remove AF\_UNIX MSG\_OOB test case.

- From: netdev-bot+sashiko@kernel.org
- Date: 2026-11-17 17:19:32 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/11/17954383
- Thread: https://ratatoskr.run/netdev/2026/11/17941603/t.md

```text
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In test_redir() and test_send_redir_recv()
  (tools/testing/selftests/bpf/prog_tests/sockmap_redir.c), the patch…
- [Low] At this commit, the only selftest covering AF_UNIX MSG_OOB with
  sockmap is gone: the `{ AF_UNIX, SOCK_STREAM, MSG_OOB }` entry in…

--

selftests: bpf: sockmap: Remove AF_UNIX MSG_OOB test case.

This commit removes the AF_UNIX SOCK_STREAM MSG_OOB case from the
sockmap_redir selftest, because MSG_OOB support is going to be dropped
from AF_UNIX. It also removes the socket_spec.send_flags field, which is
no longer used, and the OOB handling in test_send_redir_recv() and
test_socket().

> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_redir.c b/tools/testing/selftests/bpf/prog_tests/sockmap_redir.c
> index 9c461d93113db..e73d3a674a741 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sockmap_redir.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_redir.c

[ ... ]

> @@ -255,20 +251,6 @@ static void test_send_redir_recv(int sd_send, int send_flags, int sd_peer,
>  	if (recv_buf != send_buf[0])
>  		FAIL("recv(): payload check, %02x != %02x", recv_buf, send_buf[0]);
>
> -	if (send_flags & MSG_OOB) {
> -		/* Fail reading OOB while in sockmap */
> -		try_recv("bpf.recv(sd_out, MSG_OOB)", sd_out,
> -			 MSG_OOB | MSG_DONTWAIT, false);
> -
> -		/* Remove sd_out from sockmap */
> -		xbpf_map_delete_elem(maps->out, &u32(0));
> -
> -		/* Check that OOB was dropped on redirect */
> -		try_recv("recv(sd_out, MSG_OOB)", sd_out,
> -			 MSG_OOB | MSG_DONTWAIT, false);
> -
> -		goto del_in;
> -	}

[Severity: Low]
With these assertions and the { AF_UNIX, SOCK_STREAM, MSG_OOB } entry
in test_redir() removed, does any selftest still cover AF_UNIX MSG_OOB
together with sockmap at this commit?

The kernel side is still present here. AF_UNIX send(MSG_OOB) still
works, and unix_stream_bpf_recvmsg() still has the rejection:

net/unix/unix_bpf.c:unix_stream_bpf_recvmsg() {
    ...
	if (flags & MSG_OOB)
		return -EOPNOTSUPP;
    ...
}

This seems to be intentional and only lasts until the end of the series.
After the later patch "af_unix: Remove MSG_OOB.", unix_stream_sendmsg()
and unix_dgram_sendmsg() return -EOPNOTSUPP for MSG_OOB, and the receive
paths reject it as well. At that point, the "OOB dropped on redirect"
behaviour checked here no longer exists, and the removed case would fail
at send().

Removing the test before the feature looks like the right order. This
note is only about the short coverage gap between the two patches.

[ ... ]

> @@ -365,12 +345,10 @@ static void test_redir(enum bpf_map_type type, struct redir_spec *redir,
>  {
>  	struct socket_spec *s, sockets[] = {
>  		{ AF_INET, SOCK_STREAM },
> -		// { AF_INET, SOCK_STREAM, MSG_OOB }, /* Known to be broken */

[Severity: Low]
This isn't a bug, but the commit message only mentions the AF_UNIX case
and send_flags:

  Let's remove the test case from sockmap_redir.

  Note that struct socket_spec.send_flags is no longer used so
  removed too.

This line also drops the commented-out TCP MSG_OOB entry and its "Known
to be broken" note. The entry never ran, and without send_flags it could
not stay as written: MSG_OOB would land in in[0].

Would it be worth mentioning in the commit message that the in-tree note
about TCP plus sockmap OOB being broken is removed as well?

>  		{ AF_INET6, SOCK_STREAM },
>  		{ AF_INET, SOCK_DGRAM },
>  		{ AF_INET6, SOCK_DGRAM },
>  		{ AF_UNIX, SOCK_STREAM },
> -		{ AF_UNIX, SOCK_STREAM, MSG_OOB },
>  		{ AF_UNIX, SOCK_DGRAM },

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116021845.2533130-1-kuniyu%40google.com
```
