Allow PKT_PROBE in sptps_send_record

sptps_send_record prevented PKT_PROBE to be send in send_sptps_packet.
This occurred mostly when data was on "the wire" for some subnet.
route() would then trigger try_tx/try_udp which would be dropped by
sptps_send_record producing annoying amount of "Handshake phase
not finished yet" log messages.
This commit is contained in:
thorkill 2016-05-10 00:43:43 +02:00
parent 0edef996a6
commit f7e2020b56

View file

@ -128,11 +128,13 @@ static bool send_record_priv(sptps_t *s, uint8_t type, const void *data, uint16_
// Send an application record. // Send an application record.
bool sptps_send_record(sptps_t *s, uint8_t type, const void *data, uint16_t len) { bool sptps_send_record(sptps_t *s, uint8_t type, const void *data, uint16_t len) {
if((!s->outstate) && (type != PKT_PROBE))
return error(s, EINVAL, "Handshake phase not finished yet (outstate:%x type: %d)",
s->outstate, type);
// Sanity checks: application cannot send data before handshake is finished, // Sanity checks: application cannot send data before handshake is finished,
// and only record types 0..127 are allowed. // and only record types 0..127 are allowed.
if(!s->outstate)
return error(s, EINVAL, "Handshake phase not finished yet");
if(type >= SPTPS_HANDSHAKE) if(type >= SPTPS_HANDSHAKE)
return error(s, EINVAL, "Invalid application record type"); return error(s, EINVAL, "Invalid application record type");