New feature: AKAMATCHFROMTO

This commit is contained in:
Stas Degteff 2005-09-19 18:05:35 +00:00
parent 5d0bf484fc
commit eb75fd337c
2 changed files with 12 additions and 3 deletions

View File

@ -874,6 +874,10 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
// ... but only if we did NOT change aka manually
if(AA->Aka().addr.equals(AA->aka())) {
Addr aka_addr = AA->Aka().addr;
if (CFG->akamatchfromto)
aka_addr = omsg->dest;
else
aka_addr = AA->Aka().addr;
AkaMatch(&aka_addr, &omsg->orig);
AA->SetAka(aka_addr);
}

View File

@ -214,7 +214,12 @@ int AkaMatch(ftn_addr* match, const ftn_addr* addr) {
for(a = CFG->aka.begin(), aka = 0; a != CFG->aka.end(); aka++, a++) {
if(match->equals(a->addr))
matchaka = aka;
{
if (CFG->akamatchfromto)
return aka;
else
matchaka = aka;
}
// Ignore fakenet addresses
if(a->addr.net != a->pointnet) {