94084c
commit d8302ba2da1e5ac59a1c4dc1c1207a10fdafdb08
94084c
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
94084c
Date:   Mon Oct 18 01:39:02 2021 +0200
94084c
94084c
    hurd if_index: Explicitly use AF_INET for if index discovery
94084c
    
94084c
    5bf07e1b3a74 ("Linux: Simplify __opensock and fix race condition [BZ #28353]")
94084c
    made __opensock try NETLINK then UNIX then INET. On the Hurd, only INET
94084c
    knows about network interfaces, so better actually specify that in
94084c
    if_index.
94084c
    
94084c
    (cherry picked from commit 1d3decee997ba2fc24af81803299b2f4f3c47063)
94084c
94084c
diff --git a/sysdeps/mach/hurd/if_index.c b/sysdeps/mach/hurd/if_index.c
94084c
index 0eab510453c9e861..e785ac15aa6a1002 100644
94084c
--- a/sysdeps/mach/hurd/if_index.c
94084c
+++ b/sysdeps/mach/hurd/if_index.c
94084c
@@ -32,7 +32,7 @@ unsigned int
94084c
 __if_nametoindex (const char *ifname)
94084c
 {
94084c
   struct ifreq ifr;
94084c
-  int fd = __opensock ();
94084c
+  int fd = __socket (AF_INET, SOCK_DGRAM, 0);
94084c
 
94084c
   if (fd < 0)
94084c
     return 0;
94084c
@@ -84,7 +84,7 @@ __if_nameindex (void)
94084c
   error_t err = 0;
94084c
   char data[2048];
94084c
   file_t server;
94084c
-  int fd = __opensock ();
94084c
+  int fd = __socket (AF_INET, SOCK_DGRAM, 0);
94084c
   struct ifconf ifc;
94084c
   unsigned int nifs, i;
94084c
   struct if_nameindex *idx = NULL;
94084c
@@ -169,7 +169,7 @@ char *
94084c
 __if_indextoname (unsigned int ifindex, char ifname[IF_NAMESIZE])
94084c
 {
94084c
   struct ifreq ifr;
94084c
-  int fd = __opensock ();
94084c
+  int fd = __socket (AF_INET, SOCK_DGRAM, 0);
94084c
 
94084c
   if (fd < 0)
94084c
     return NULL;