void rebind_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_40;
int local_3c;
int local_38;
undefined4 *local_30;
piVar9 = *(int **)(param_1 + 0x50);
do {
if (piVar9 == (int *)0x0) {
return;
}
local_30 = &local_40;
piVar7 = (int *)piVar9[4];
while (piVar7 != (int *)0x0) {
while( true ) {
piVar8 = (int *)*piVar7;
iVar2 = *(int *)(piVar7[2] + 8);
if (iVar2 == 0) {
puVar6 = &DAT_00429fec;
}
else if (iVar2 == 1) {
puVar6 = &DAT_00429fe8;
}
else {
puVar6 = &DAT_00427600;
}
dprintf(7,"rebind_ia","rebind 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;
}
piVar7[5] = 2;
dhcp6_remove_timer(piVar7 + 6);
puVar1 = (undefined4 *)dhcp6_create_event(piVar7[8],5);
if (puVar1 == (undefined4 *)0x0) break;
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,"rebind_ia","failed to create a new event timer");
LAB_00414ab0:
dhcp6_remove_event(puVar1);
}
else {
puVar5 = (undefined4 *)malloc(0x1c) //possible issue identified - semgrep
if (puVar5 == (undefined4 *)0x0) {
dprintf(5,"rebind_ia","failed to create a new event data");
goto LAB_00414ab0;
}
puVar5[3] = 0;
puVar5[1] = 0;
puVar5[4] = 0;
puVar5[5] = 0;
puVar5[6] = 0;
local_40 = *(undefined4 *)(piVar7[2] + 0xc);
puVar5[1] = puVar1[0x14];
local_3c = piVar7[3];
puVar4 = (undefined4 *)puVar1[0x14];
local_38 = piVar7[4];
iVar2 = piVar7[0xb];
*puVar5 = 0;
*puVar4 = puVar5;
puVar5[2] = puVar1;
puVar1[0x14] = puVar5;
if (iVar2 != 0) {
if ((*(code **)(iVar2 + 0x14) != (code *)0x0) &&
(iVar2 = (**(code **)(iVar2 + 0x14))(iVar2,local_30,piVar7 + 7,puVar5), iVar2 != 0))
{
dprintf(5,"rebind_ia","failed to make renew data");
goto LAB_00414ab0;
}
}
puVar1[0xd] = 0;
dhcp6_set_timeoparam(puVar1);
dhcp6_reset_timer(puVar1);
if (piVar7[0xc] != 0) {
iVar2 = copy_authparam();
puVar1[0x12] = iVar2;
if (iVar2 == 0) {
dprintf(4,"rebind_ia","failed to copy authparam");
goto LAB_00414ab0;
}
}
piVar7[7] = (int)puVar5;
client6_send(puVar1);
}
piVar7 = piVar8;
if (piVar8 == (int *)0x0) goto LAB_00414a50;
}
dprintf(5,"rebind_ia","failed to create a new event");
piVar7 = piVar8;
}
LAB_00414a50:
piVar9 = (int *)*piVar9;
} while( true );
}