X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_packet.c;h=f79c9a75ac7e6795a70a1abe64fc42eb2886b870;hb=707914e0e4b45183b1f687b44d97731127df3078;hp=1254e48432d7822dd5057c9638cf68c460ded890;hpb=ae85a020303d523f24ddf45a816e6a2ceb4fc935;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index 1254e484..f79c9a75 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -776,10 +776,12 @@ bool send_sptps_data(void *handle, uint8_t type, const char *data, size_t len) { b64encode(data, buf, len); /* If no valid key is known yet, send the packets using ANS_KEY requests, to ensure we get to learn the reflexive UDP address. */ - if(!to->status.validkey) - return send_request(to->nexthop->connection, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, myself->name, to->name, buf, myself->incompression); - else + if(!to->status.validkey) { + to->incompression = myself->incompression; + return send_request(to->nexthop->connection, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, myself->name, to->name, buf, to->incompression); + } else { return send_request(to->nexthop->connection, "%d %s %s %d %s", REQ_KEY, myself->name, to->name, REQ_SPTPS, buf); + } } /* Otherwise, send the packet via UDP */ @@ -959,7 +961,7 @@ void broadcast_packet(const node_t *from, vpn_packet_t *packet) { break; for splay_each(node_t, n, node_tree) - if(n->status.reachable && ((n->via == myself && n->nexthop == n) || n->via == n)) + if(n->status.reachable && n != myself && ((n->via == myself && n->nexthop == n) || n->via == n)) send_packet(n, packet); break;