… | |
… | |
330 | EVP_DecryptFinal_ex (cctx, (unsigned char *)d + outl, &outl2); |
330 | EVP_DecryptFinal_ex (cctx, (unsigned char *)d + outl, &outl2); |
331 | outl += outl2; |
331 | outl += outl2; |
332 | |
332 | |
333 | seqno = *(u32 *)(d + RAND_SIZE); |
333 | seqno = *(u32 *)(d + RAND_SIZE); |
334 | |
334 | |
335 | id2mac (dst (), p->dst); |
335 | id2mac (dst () ? dst() : THISNODE->id, p->dst); |
336 | id2mac (src (), p->src); |
336 | id2mac (src (), p->src); |
337 | |
337 | |
338 | #if ENABLE_COMPRESSION |
338 | #if ENABLE_COMPRESSION |
339 | if (type == PT_DATA_COMPRESSED) |
339 | if (type == PT_DATA_COMPRESSED) |
340 | { |
340 | { |
341 | u32 cl = (d[DATAHDR] << 8) | d[DATAHDR + 1]; |
341 | u32 cl = (d[DATAHDR] << 8) | d[DATAHDR + 1]; |
… | |
… | |
1136 | { |
1136 | { |
1137 | connection *c = find_router (); |
1137 | connection *c = find_router (); |
1138 | |
1138 | |
1139 | if (c) |
1139 | if (c) |
1140 | c->connect_request (id); |
1140 | c->connect_request (id); |
|
|
1141 | //else // does not work, because all others must connect to the same router |
|
|
1142 | // // no router found, aggressively connect to all routers |
|
|
1143 | // for (conns_vector::iterator i = conns.begin (); i != conns.end (); ++i) |
|
|
1144 | // if ((*i)->conf->routerprio) |
|
|
1145 | // (*i)->establish_connection (); |
1141 | } |
1146 | } |
1142 | |
1147 | |
1143 | void |
1148 | void |
1144 | vpn::main_loop () |
1149 | vpn::main_loop () |
1145 | { |
1150 | { |