ykaliuta / fidogate

FidoGate
GNU General Public License v2.0
12 stars 6 forks source link

Best AKA not selected by ftntoss #24

Closed dolikdev closed 2 years ago

dolikdev commented 2 years ago

System is configured with 2 AKAs in the same network: 2:463/1331 & 2:463/0 and BEST_AKA option is enabled during fidogate build time. EchoMail packet is created like this:

$ cat text.txt | ftnoutpkt -f "SysOp@2:463/0" -s "Test Subject" -A HUGAYDA.TEST "All@2:463/0"

debug shows best AKA works:

...
Select best AKA: 2:463/0.0  Uplink: 0:0/0.0
...

However, when runinc and then ftntoss processes the packet, it's being discarded due to circular path:

...
Select Z2 AKA: 2:463/1331.0  Uplink: 0:0/0.0
SEEN+BY: 2:463/0
Path   : 2:463/0
SEEN+BY: 2:463/0 2:463/1331
Path   : 2:463/0 2:463/1331
New    : 2:463/1331.1
May 18 13:07:33 ftntoss circular path echomail area HUGAYDA.TEST from 2:463/0.0 to 2:463/0.0
...

This will work, if I change order of addresses so 2:463/0 will come as first & default AKA. However, then failures will appear for packets made with 2nd AKA.

ykaliuta commented 2 years ago

Well, since the original authors of the code are not available, I cannot be sure how it was supposed to work, but what I see in the code is:

    /* Set address for this area */
    if (area->zone != -1)
        cf_set_zone(area->zone);
    if (area->addr.zone != -1)
        cf_set_curr(&area->addr);

It means, that if the area has -z in areas.bbs, it sets zone's aka (and in the log it does: Select Z2 AKA: 2:463/1331.0 Uplink: 0:0/0.0). But then if there would be -a there as well, it would try to run the best aka logic from cf_set_curr()

Regarding the circular path itself, you see it adds 2:463/1331 (Path : 2:463/0 2:463/1331) due to described AKA selection above. And since 2:463/0 is own AKA it is detected as circular.

I should spend some time to understand the original ideas behind it :)

ykaliuta commented 2 years ago

BTW, 'best aka' does not look suitable for the address selection, it's supposed to be used to select own AKA for a destination, here the source is under consideration. Wouldn't you agree?

dolikdev commented 2 years ago

Verified with ftntoss - a and indeed it works as expected, but as you correctly said in your last comment, this feature intended for destination, not a source. Looks like I have misunderstood the use case, thanks again.

dolikdev commented 2 years ago

BEST_AKA feature works as expected, some documentation improvement may be considered in the future.

ykaliuta commented 2 years ago

Well, I still think there is a room for improvement here. Adding own AKA to the PATH does not look really correct for me. At least AKA from the same zone. I just do not want to break something I'm missing, it's pretty fragile (from the experience :)