BUG/MINOR: h3: fix return value on decode_qcs on error

Convert return code to -1 when an error has been detected. This is
required since the previous API change on return value from the patch :

  1f21ebdd76
  MINOR: mux-quic/h3: adjust demuxing function return values

Without this, QUIC MUX won't consider the call as an error and will try
to remove one byte from the buffer. This may cause a BUG_ON failure if
the buffer is empty at this stage.

This bug was introduced in the current dev tree. Does not need to be
backported.
This commit is contained in:
Amaury Denoyelle 2022-06-07 18:24:34 +02:00
parent 1f21ebdd76
commit dca4c53a95

View file

@ -614,7 +614,7 @@ static ssize_t h3_decode_qcs(struct qcs *qcs, struct buffer *b, int fin)
if (!h3_is_frame_valid(h3c, qcs, ftype)) {
qcc_emit_cc_app(qcs->qcc, H3_FRAME_UNEXPECTED);
return 1;
return -1;
}
if (!b_data(b))
@ -636,7 +636,7 @@ static ssize_t h3_decode_qcs(struct qcs *qcs, struct buffer *b, int fin)
*/
if (flen > QC_S_RX_BUF_SZ) {
qcc_emit_cc_app(qcs->qcc, H3_EXCESSIVE_LOAD);
return 1;
return -1;
}
break;
}
@ -666,7 +666,7 @@ static ssize_t h3_decode_qcs(struct qcs *qcs, struct buffer *b, int fin)
ret = h3_parse_settings_frm(qcs->qcc->ctx, b, flen);
if (ret < 0) {
qcc_emit_cc_app(qcs->qcc, h3c->err);
return 1;
return -1;
}
h3c->flags |= H3_CF_SETTINGS_RECV;
break;