friend of a friend type darknets

Alex allo at laxu.de
Mon Sep 20 19:07:01 CEST 2010


Hi!
On Mon, Sep 20, 2010 at 05:59:40PM +0200, Guus Sliepen wrote:
> On Mon, Sep 20, 2010 at 03:39:32PM +0200, Alex wrote:
> 
>>> No, since that will be two distinct edges, a B->A edge and a C->A edge.  But
>>> suppose A has FriendOfAFriend set, but B and C do not, and B and C are also
>>> connected to each other. Then it is possible that the B->C edge information
>>> (that B sends to A and C  at some point) gets anonymised by A and forwarded to
>>> C, which sees new information, and forwards it in turn to B, which will see
>>> that someone forwarded the B->C edge, but with wrong IP address information.
>> Okay. if i do it in add_edge_h, too it should work, shouldn't it? i'm
>> only not sure at the moment where the direct connection information is
>> stored, and i should set up a few test-vms to test a whole net next.
> 
> You really should handle this in all edge related functions.
I'm just not sure, where i should avoid it, to prevent tinc from thinking its direct-peers are at 0.0.0.0. if i replace the ip at this places, it will not work at all. with tcp it may still work, but with udp it would be definitly broken.

> 
>> diff -Nur tinc-1.0.13/src/protocol_edge.c tinc-1.0.13-patched/src/protocol_edge.c
>> --- tinc-1.0.13/src/protocol_edge.c 2010-03-13 18:53:33.000000000 +0100
>> +++ tinc-1.0.13-patched/src/protocol_edge.c 2010-09-20 15:32:02.602441373 +0200
>> @@ -109,7 +115,14 @@
>>  
>>     /* Convert addresses */
>>  
>> -   address = str2sockaddr(to_address, to_port);
>> +    if(foaf){
>> +        char *host=xstrdup("0.0.0.0");
>> +        char *port=xstrdup("0");
>> +        address = str2sockaddr(host, port);
>> +        free(host);free(port);
>> +    }else{
>> +       address = str2sockaddr(to_address, to_port);
>> +    }
> 
> You don't need the xstrdup() and free() here of course. Also, you only modify
> the locally stored address and port to 0.0.0.0:0. But the request gets
> forwarded later on (line 155) with the original address and port.
hm, i'm a not so frequent C developer and wanted to avoid a memleak there. I just hoped some tinc developer would get interest in the idea ;). 

Alex


More information about the tinc-devel mailing list