undefined4 FUN_00402ee8(void *param_1)
{
int __fd;
int *piVar1;
char *pcVar2;
int iVar3;
char *__src;
char local_40 [24];
undefined1 auStack_28 [20];
__src = g_interface;
if (g_interface == (char *)0x0) {
__src = local_40;
}
pcVar2 = local_40 + 4;
builtin_strncpy(local_40,"br0",4) //possible issue identified - semgrep
memset(pcVar2,0,0x20) //possible issue identified - semgrep
strncpy(pcVar2,__src,0x10) //possible issue identified - semgrep
__fd = socket(2,1,0);
if (__fd < 0) {
piVar1 = __errno_location();
pcVar2 = strerror(*piVar1);
warn("get_ipv4addr: FAILED creating request socket for \'%s\' : %s\n",__src,pcVar2);
}
else {
iVar3 = ioctl(__fd,0x8915,pcVar2);
if (-1 < iVar3) {
close(__fd);
memcpy(param_1,auStack_28,4) //possible issue identified - semgrep
return 1;
}
piVar1 = __errno_location();
pcVar2 = strerror(*piVar1);
warn("get_ipv4addr(%d,%s): FAILED : %s\n",__fd,__src,pcVar2);
}
return 0;
}