uint if_nametoindex(char *__ifname)

{
  int __fd;
  int iVar1;
  int *piVar2;
  char acStack_30 [16];
  uint local_20;
  
  __fd = FUN_00408250();
  if (-1 < __fd) {
    strncpy(acStack_30,__ifname,0x10)   //possible issue identified - semgrep
    iVar1 = ioctl(__fd,0x8933,acStack_30);
    if (-1 < iVar1) {
      close(__fd);
      return local_20;
    }
    piVar2 = __errno_location();
    iVar1 = *piVar2;
    close(__fd);
    if (iVar1 != 0x16) {
      return 0;
    }
    *piVar2 = 0x59;
  }
  return 0;
}