Re: [PATCH bpf v3 3/4] selftests/bpf: Adapt sockmap update error handling
From: Michal Luczaj
Date: Thu Jul 02 2026 - 03:47:04 EST
On 7/2/26 02:00, bot+bpf-ci@xxxxxxxxxx wrote:
>> @@ -93,8 +90,12 @@ static void test_insert_bound(struct test_sockmap_listen *skel __always_unused,
>> errno = 0;
>> value = s;
>> err = bpf_map_update_elem(mapfd, &key, &value, BPF_NOEXIST);
>> - if (!err || errno != EOPNOTSUPP)
>> - FAIL_ERRNO("map_update: expected EOPNOTSUPP");
>> + if (sotype == SOCK_STREAM) {
>> + ASSERT_ERR(err, "map_update");
>> + ASSERT_EQ(errno, EOPNOTSUPP, "errno");
>> + } else if (err) {
>> + ASSERT_OK(err, "map_update");
>> + }
>
> This isn't a bug, but could the UDP branch just be `else ASSERT_OK(err,
> "map_update");` — the `if (err)` guard looks redundant since ASSERT_OK is
> a no-op on success?
Ugh, sorry. If there are no other comments for this series, I'd happy to
fix it later in bpf-next.