ifc.ifc_len = sizeof (data);
if_nameindex (void){  error_t err = 0;  char data[2048];  file_t server;  int fd = __opensock ();  struct ifconf ifc;  unsigned int nifs, i;  struct if_nameindex *idx = NULL;  ifc.ifc_buf = data;  ifc.ifc_len = sizeof (data);  if (fd < 0)    return NULL;  server = _hurd_socket_server (PF_INET, 0);  if (server == MACH_PORT_NULL)    nifs = 0;  else    {      err = __pfinet_siocgifconf (server, -1, &ifc.ifc_buf,				  &ifc.ifc_len);      if (err == MACH_SEND_INVALID_DEST || err == MIG_SERVER_DIED)	{	  /* On the first use of the socket server during the operation,	     allow for the old server port dying.  */	  server = _hurd_socket_server (PF_INET, 1);	  if (server == MACH_PORT_NULL)	    goto out;	  err = __pfinet_siocgifconf (server, -1, &ifc.ifc_buf,				      &ifc.ifc_len);	}      if (err)	goto out;      nifs = ifc.ifc_len / sizeof (struct ifreq);    }  idx = malloc ((nifs + 1) * sizeof (struct if_nameindex));  if (idx == NULL)    {      err = ENOBUFS;      goto out;    }  for (i = 0; i < nifs; ++i)    {      struct ifreq *ifr = &ifc.ifc_req[i];      idx[i].if_name = __strdup (ifr->ifr_name);      if (idx[i].if_name == NULL          || __ioctl (fd, SIOCGIFINDEX, ifr) < 0)        {          unsigned int j;          err = errno;          for (j =  0; j < i; ++j)            free (idx[j].if_name);          free (idx);	  idx = NULL;          if (err == EINVAL)            err = ENOSYS;          else if (err == ENOMEM)            err = ENOBUFS;          goto out;        }      idx[i].if_index = ifr->ifr_ifindex;    }  idx[i].if_index = 0;  idx[i].if_name = NULL; out:  __close (fd);  if (data != ifc.ifc_buf)    __vm_deallocate (__mach_task_self (), (vm_address_t) ifc.ifc_buf,		     ifc.ifc_len);  __set_errno (err);  return idx;}