X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_packet.c;fp=src%2Fnet_packet.c;h=6f7a3a101b7d5182c89998ab886b841d017616ad;hb=e6249695684dcddc5d7ae0269adc7764ecec925a;hp=1254e48432d7822dd5057c9638cf68c460ded890;hpb=5fca595b80f5d2a6629d74e89ca2ef46ba9ae292;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index 1254e484..6f7a3a10 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 */