Fix bogus too many CID message
@@ -5535,6 +5535,9 @@ static int conn_recv_new_connection_id(ngtcp2_conn *conn,
if (rv != 0) {
return rv;
}
+ if (ngtcp2_cid_eq(&conn->dcid.current.cid, &fr->cid)) {
+ return 0;
+ }
if (pv) {
rv = ngtcp2_dcid_verify_uniqueness(&pv->dcid, fr->seq, &fr->cid,
@@ -5542,6 +5545,9 @@ static int conn_recv_new_connection_id(ngtcp2_conn *conn,
if (rv != 0) {
return rv;
}
+ if (ngtcp2_cid_eq(&pv->dcid.cid, &fr->cid)) {
+ return 0;
+ }
}
len = ngtcp2_ringbuf_len(&conn->dcid.bound);
@@ -5553,6 +5559,9 @@ static int conn_recv_new_connection_id(ngtcp2_conn *conn,
if (rv != 0) {
return NGTCP2_ERR_PROTO;
}
+ if (ngtcp2_cid_eq(&dcid->cid, &fr->cid)) {
+ return 0;
+ }
}
len = ngtcp2_ringbuf_len(&conn->dcid.unused);
@@ -5564,6 +5573,9 @@ static int conn_recv_new_connection_id(ngtcp2_conn *conn,
if (rv != 0) {
return NGTCP2_ERR_PROTO;
}
+ if (ngtcp2_cid_eq(&dcid->cid, &fr->cid)) {
+ return 0;
+ }
}
if (len >= NGTCP2_MAX_DCID_POOL_SIZE) {
