void confirm_all_ia(int param_1)
{
undefined4 *puVar1;
int iVar2;
int *piVar3;
void *__ptr;
undefined4 *puVar4;
undefined4 *puVar5;
undefined *puVar6;
int *piVar7;
int *piVar8;
int *piVar9;
undefined4 local_38;
int local_34;
int local_30;
piVar8 = *(int **)(param_1 + 0x50);
do {
if (piVar8 == (int *)0x0) {
return;
}
if ((int *)piVar8[4] != (int *)0x0) {
piVar7 = (int *)piVar8[4];
do {
piVar9 = (int *)*piVar7;
if ((piVar7[5] == 0) && (piVar8[2] != 0)) {
iVar2 = *(int *)(piVar7[2] + 8);
piVar7[5] = 3;
if (iVar2 == 0) {
puVar6 = &DAT_00429fec;
}
else if (iVar2 == 1) {
puVar6 = &DAT_00429fe8;
}
else {
puVar6 = &DAT_00427600;
}
dprintf(7,"confirm_ia","confirming IA: %s-%lu",puVar6,*(undefined4 *)(piVar7[2] + 0xc));
piVar3 = (int *)piVar7[7];
if (piVar3 != (int *)0x0) {
if (*piVar3 == 0) {
*(int *)(piVar3[2] + 0x50) = piVar3[1];
}
else {
*(int *)(*piVar3 + 4) = piVar3[1];
}
*(int *)piVar3[1] = *piVar3;
__ptr = (void *)piVar7[7];
if (*(code **)((int)__ptr + 0x14) != (code *)0x0) {
(**(code **)((int)__ptr + 0x14))();
__ptr = (void *)piVar7[7];
}
free(__ptr);
piVar7[7] = 0;
}
if (piVar7[6] != 0) {
dhcp6_remove_timer(piVar7 + 6);
}
puVar1 = (undefined4 *)dhcp6_create_event(piVar7[8],8);
if (puVar1 == (undefined4 *)0x0) {
dprintf(5,"confirm_ia","failed to create a new event");
}
else {
iVar2 = piVar7[8];
puVar1[1] = *(undefined4 *)(iVar2 + 0xc);
puVar5 = *(undefined4 **)(iVar2 + 0xc);
*puVar1 = 0;
*(undefined4 **)(iVar2 + 0xc) = puVar1;
*puVar5 = puVar1;
iVar2 = dhcp6_add_timer(client6_timo,puVar1);
puVar1[3] = iVar2;
if (iVar2 == 0) {
dprintf(5,"confirm_ia","failed to create a new event timer");
}
else {
puVar5 = (undefined4 *)malloc(0x1c) //possible issue identified - semgrep
if (puVar5 == (undefined4 *)0x0) {
dprintf(5,"confirm_ia","failed to create a new event data");
}
else {
puVar5[3] = 0;
puVar5[1] = 0;
puVar5[4] = 0;
puVar5[5] = 0;
puVar5[6] = 0;
local_38 = *(undefined4 *)(piVar7[2] + 0xc);
puVar5[1] = puVar1[0x14];
local_34 = piVar7[3];
puVar4 = (undefined4 *)puVar1[0x14];
local_30 = piVar7[4];
iVar2 = piVar7[0xb];
*puVar5 = 0;
*puVar4 = puVar5;
puVar5[2] = puVar1;
puVar1[0x14] = puVar5;
if (((iVar2 == 0) || (*(code **)(iVar2 + 0x1c) == (code *)0x0)) ||
(iVar2 = (**(code **)(iVar2 + 0x1c))(iVar2,&local_38,piVar7 + 7,puVar5),
iVar2 == 0)) {
if (piVar7[0xc] != 0) {
iVar2 = copy_authparam();
puVar1[0x12] = iVar2;
if (iVar2 == 0) {
dprintf(4,"confirm_ia","failed to copy authparam");
goto LAB_00414ebc;
}
}
puVar1[0xd] = 0;
dhcp6_set_timeoparam(puVar1);
dhcp6_reset_timer(puVar1);
piVar7[7] = (int)puVar5;
client6_send(puVar1);
goto LAB_00414ddc;
}
dprintf(5,"confirm_ia","failed to make reestablish data");
}
}
LAB_00414ebc:
dhcp6_remove_event(puVar1);
}
}
LAB_00414ddc:
piVar7 = piVar9;
} while (piVar9 != (int *)0x0);
}
piVar8 = (int *)*piVar8;
} while( true );
}