The logic always skipped the first unique address found via edges, and since
in most cases there is only one such address, this would skip them altogether.
}
if(outgoing->state == OUTGOING_KNOWN) {
- if(outgoing->aip || get_recent(mesh, outgoing)) {
- if(get_next_ai(mesh, outgoing)) {
- return true;
- } else {
- free_known_addresses(outgoing->ai);
- outgoing->ai = NULL;
- outgoing->aip = NULL;
- }
+ if(!outgoing->aip) {
+ get_recent(mesh, outgoing);
+ } else {
+ outgoing->aip = outgoing->aip->ai_next;
+ }
+
+ if(outgoing->aip) {
+ return true;
+ } else {
+ free_known_addresses(outgoing->ai);
+ outgoing->ai = NULL;
+ outgoing->aip = NULL;
}
outgoing->state = OUTGOING_END;