From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] Linux: Implement opensock using Netlink sockets
Date: Mon, 18 Jun 2018 17:09:00 -0000 [thread overview]
Message-ID: <4e69cf5f-309f-007b-bc11-397e831566bd@linaro.org> (raw)
In-Reply-To: <b5264b3a-c8b5-aba8-80c6-dade7fe7c450@redhat.com>
On 18/06/2018 11:25, Florian Weimer wrote:
> On 06/18/2018 03:56 PM, Adhemerval Zanella wrote:
>>
>>
>> On 18/06/2018 07:50, Florian Weimer wrote:
>>> inet/tst-inet6_scopeid_pton uses __opensock indirectly, to call ioctl
>>> with SIOCGIFINDEX, and it still works after this change.
>>>
>>> 2018-06-18 Florian Weimer <fweimer@redhat.com>
>>>
>>> Â Â Â Â * sysdeps/unix/sysv/linux/opensock.c (__opensock): Unconditionally
>>> Â Â Â Â return a Netlink socket.
>>> Â Â Â Â * sysdeps/unix/sysv/linux/s390/opensock.c: Remove file.
>>
>> Similar to a previous attempt to use AF_NETLINK sockets as default [1],
>> I am seeing some regression on testcases with Linux 4.4.0-116-generic:
>>
>> FAIL: inet/bug-if1
>> FAIL: inet/test_ifindex
>> FAIL: inet/tst-inet6_scopeid_pton
>>
>> $ ./testrun.sh inet/bug-if1
>> errno = 95 (Operation not supported), expected 6 (No such device or address)
>>
>> $ strace -f ./testrun.sh inet/bug-if1 --direct
>> [...]
>> socket(AF_NETLINK, SOCK_DGRAM|SOCK_CLOEXEC, NETLINK_ROUTE) = 3
>> ioctl(3, SIOCGIFNAME, {ifr_index=0})Â Â Â = -1 EOPNOTSUPP (Operation not supported)
>> [...]
>
> Huh. Any idea why this happens? I don't see how this is possible based on the kernel sources.
>
> Ahh, it's been fixed since then. Netlink sockets were one of the few which did not perform ENOIOCTLCMD fallback. This was changed in kernel 4.6:
>
> commit 025c68186e07afaededa84143f1a22f273cd3f67
> Author: David Decotigny <decot@googlers.com>
> Date:Â Â Mon Mar 21 10:15:35 2016 -0700
>
> Â Â Â netlink: add support for NIC driver ioctls
>
> Â Â Â By returning -ENOIOCTLCMD, sock_do_ioctl() falls back to calling
> Â Â Â dev_ioctl(), which provides support for NIC driver ioctls, which
> Â Â Â includes ethtool support. This is similar to the way ioctls are
> Â Â Â handled in udp.c or tcp.c.
>
> Â Â Â This removes the requirement that ethtool for example be tied to the
> Â Â Â support of a specific L3 protocol (ethtool uses an AF_INET socket
> Â Â Â today).
>
> It's unfortunate that it took that long to make this change.
>
> Thanks,
> Florian
Indeed, so I think we will need the fallback options (maybe we can restrict
to some options).
next prev parent reply other threads:[~2018-06-18 17:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-18 10:50 Florian Weimer
2018-06-18 13:57 ` Adhemerval Zanella
2018-06-18 14:25 ` Florian Weimer
2018-06-18 17:09 ` Adhemerval Zanella [this message]
2018-06-18 17:11 ` Florian Weimer
2018-06-18 17:17 ` Adhemerval Zanella
2018-06-18 17:28 ` Florian Weimer
2018-06-18 16:47 ` Ben Hutchings
2018-06-18 17:13 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4e69cf5f-309f-007b-bc11-397e831566bd@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).