[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7219eb87-8211-bfff-5d63-f1483973dab6@huawei.com>
Date: Wed, 12 Jul 2023 11:42:33 +0300
From: "Konstantin Meskhidze (A)" <konstantin.meskhidze@...wei.com>
To: Mickaël Salaün <mic@...ikod.net>
CC: <artem.kuzin@...wei.com>, <gnoack3000@...il.com>,
<willemdebruijn.kernel@...il.com>, <yusongping@...wei.com>,
<linux-security-module@...r.kernel.org>, <netdev@...r.kernel.org>,
<netfilter-devel@...r.kernel.org>
Subject: Re: [PATCH v11.1] selftests/landlock: Add 11 new test suites
dedicated to network
7/10/2023 7:06 PM, Mickaël Salaün пишет:
>
> On 06/07/2023 16:55, Mickaël Salaün wrote:
>> From: Konstantin Meskhidze <konstantin.meskhidze@...wei.com>
>>
>> This patch is a revamp of the v11 tests [1] with new tests (see the
>> "Changes since v11" description). I (Mickaël) only added the following
>> todo list and the "Changes since v11" sections in this commit message.
>> I think this patch is good but it would appreciate reviews.
>> You can find the diff of my changes here but it is not really readable:
>> https://git.kernel.org/mic/c/78edf722fba5 (landlock-net-v11 branch)
>> [1] https://lore.kernel.org/all/20230515161339.631577-11-konstantin.meskhidze@huawei.com/
>> TODO:
>> - Rename all "net_service" to "net_port".
>> - Fix the two kernel bugs found with the new tests.
>> - Update this commit message with a small description of all tests.
>>
>
>
> [...]
>
>> +static int bind_variant_addrlen(const int sock_fd,
>> + const struct service_fixture *const srv,
>> + const socklen_t addrlen)
>> +{
>> + int ret;
>> +
>> + switch (srv->protocol.domain) {
>> + case AF_UNSPEC:
>> + case AF_INET:
>> + ret = bind(sock_fd, &srv->ipv4_addr, addrlen);
>> + break;
>> +
>> + case AF_INET6:
>> + ret = bind(sock_fd, &srv->ipv6_addr, addrlen);
>> + break;
>> +
>> + case AF_UNIX:
>> + ret = bind(sock_fd, &srv->unix_addr, addrlen);
>> + break;
>> +
>> + default:
>> + errno = -EAFNOSUPPORT;
>
> This should be `errno = EAFNOSUPPORT`
Ok. Got it.
>
>> + return -errno;
>> + }
>> +
>> + if (ret < 0)
>> + return -errno;
>> + return ret;
> .
Powered by blists - more mailing lists