public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v3] Linux: Simplify __opensock and fix race condition [BZ #28353]
Date: Mon, 8 Nov 2021 14:22:29 -0300	[thread overview]
Message-ID: <371babb1-e79e-fb0b-b021-fa167bf023b0@linaro.org> (raw)
In-Reply-To: <87wnn1df57.fsf@oldenburg.str.redhat.com>



On 27/09/2021 15:53, Florian Weimer via Libc-alpha wrote:
> AF_NETLINK support is not quite optional on modern Linux systems
> anymore, so it is likely that the first attempt will always succeed.
> Consequently, there is no need to cache the result.  Keep AF_UNIX
> and the Internet address families as a fallback, for the rare case
> that AF_NETLINK is missing.  The other address families previously
> probed are totally obsolete be now, so remove them.
> 
> Use this simplified version as the generic implementation, disabling
> Netlink support as needed.

It seems that defaulting to AF_NETLINKS fails for some operations on
older kernels:

$ uname -a
Linux ubuntu16 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ ./testrun.sh --tool=strace inet/test_ifindex --direct
[...]
socket(PF_NETLINK, SOCK_DGRAM|SOCK_CLOEXEC, NETLINK_ROUTE) = 3
ioctl(3, SIOCGIFINDEX, {ifr_name="lo"}) = -1 EOPNOTSUPP (Operation not supported)
close(3)                                = 0

I am not sure if this something related to the system configuration or
some security features, but AF_UNIX does work in this case.

  parent reply	other threads:[~2021-11-08 17:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 18:53 Florian Weimer
2021-09-28 14:38 ` Adhemerval Zanella
2021-11-08 17:22 ` Adhemerval Zanella [this message]
2021-11-17 13:54   ` 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=371babb1-e79e-fb0b-b021-fa167bf023b0@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).