You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jsoninfo plugin does not update the IP address in "lastHopIP" and "destinationIP" fileds. To solve this modify olsr_change_myself_tc function:
void
olsr_change_myself_tc(void)
{
if (tc_myself)
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Added by Ala
struct ipaddr_str buf;
struct olsr_if *tmp_if;
bool mainIPCahnged = true;
int numIPs=0;
// Run trough all interfaces and count number of valid interfaces
for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next)
{
if(tmp_if->interf)
{
if(inet_ntoa(tmp_if->interf->int_addr.sin_addr) !=0 )
{
numIPs++;
}
}
else
{
OLSR_PRINTF(1, "Interface has no address\n");
}
}
if(numIPs == 0)
{
OLSR_PRINTF(1, "error no active interface\n");
}
else if(numIPs == 1)
// Run trough all interfaces again and check if olsr_cnf->main_addr is still valid
for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next)
if(tmp_if->interf)
{
if(inet_ntoa(tmp_if->interf->int_addr.sin_addr) !=0 )
{
if(strcmp(inet_ntoa(tmp_if->interf->int_addr.sin_addr), ip4_to_string(&buf, olsr_cnf->main_addr.v4))==0)
{
OLSR_PRINTF(1, "main IP still valid\n");
mainIPCahnged = false;
}
else // reset the new main ip address
{
OLSR_PRINTF(1, "reset olsr_cnf->main_addr to new IP \n");
olsr_cnf->main_addr.v4 = tmp_if->interf->int_addr.sin_addr;
}
}
}
else
{
OLSR_PRINTF(1, "interface has no address\n");
}
else if(numIPs == 2)
{
// change here if you find some future bugs
OLSR_PRINTF(1, "two active interfaces\n");
}
if(mainIPCahnged)
{
OLSR_PRINTF(1, "modified olsr_cnf->main_addr:%s\n", ip4_to_string(&buf, olsr_cnf->main_addr.v4));
}
// End by Ala
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (ipequal(&tc_myself->addr, &olsr_cnf->main_addr))
{
return;
}
/*
* Flush our own tc_entry.
*/
olsr_delete_tc_entry(tc_myself);
}
/*
* The old entry for ourselves is gone, generate a new one and trigger SPF.
*/
tc_myself = olsr_add_tc_entry(&olsr_cnf->main_addr);
changes_topology = true;
}
The text was updated successfully, but these errors were encountered:
Hello @altaweelala1983, many thanks for reporting the issue. Since it's not fully clear to me what you had change - can you possibly create a patch or pull request so we can update the source here as well?
jsoninfo plugin does not update the IP address in "lastHopIP" and "destinationIP" fileds. To solve this modify olsr_change_myself_tc function:
void
olsr_change_myself_tc(void)
{
if (tc_myself)
{
}
The text was updated successfully, but these errors were encountered: