public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] hurd if_index: Explicitly use AF_INET for if index discovery Date: Sun, 17 Oct 2021 23:40:46 +0000 (GMT) [thread overview] Message-ID: <20211017234046.0BC4B3858D35@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1d3decee997ba2fc24af81803299b2f4f3c47063 commit 1d3decee997ba2fc24af81803299b2f4f3c47063 Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Mon Oct 18 01:39:02 2021 +0200 hurd if_index: Explicitly use AF_INET for if index discovery 5bf07e1b3a74 ("Linux: Simplify __opensock and fix race condition [BZ #28353]") made __opensock try NETLINK then UNIX then INET. On the Hurd, only INET knows about network interfaces, so better actually specify that in if_index. Diff: --- sysdeps/mach/hurd/if_index.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysdeps/mach/hurd/if_index.c b/sysdeps/mach/hurd/if_index.c index 0eab510453..e785ac15aa 100644 --- a/sysdeps/mach/hurd/if_index.c +++ b/sysdeps/mach/hurd/if_index.c @@ -32,7 +32,7 @@ unsigned int __if_nametoindex (const char *ifname) { struct ifreq ifr; - int fd = __opensock (); + int fd = __socket (AF_INET, SOCK_DGRAM, 0); if (fd < 0) return 0; @@ -84,7 +84,7 @@ __if_nameindex (void) error_t err = 0; char data[2048]; file_t server; - int fd = __opensock (); + int fd = __socket (AF_INET, SOCK_DGRAM, 0); struct ifconf ifc; unsigned int nifs, i; struct if_nameindex *idx = NULL; @@ -169,7 +169,7 @@ char * __if_indextoname (unsigned int ifindex, char ifname[IF_NAMESIZE]) { struct ifreq ifr; - int fd = __opensock (); + int fd = __socket (AF_INET, SOCK_DGRAM, 0); if (fd < 0) return NULL;
reply other threads:[~2021-10-17 23:40 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20211017234046.0BC4B3858D35@sourceware.org \ --to=sthibaul@sourceware.org \ --cc=glibc-cvs@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: linkBe 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).