* for a single connection, so a zero-length local CID can be used.
*/
int is_multi_conn;
+
+ /*
+ * if 1, this port should do server address validation
+ */
+ int do_addr_validation;
} QUIC_PORT_ARGS;
/* Only QUIC_ENGINE should use this function. */
port->engine = args->engine;
port->channel_ctx = args->channel_ctx;
port->is_multi_conn = args->is_multi_conn;
+ port->validate_addr = args->do_addr_validation;
if (!port_init(port)) {
OPENSSL_free(port);
* states in TCP. If we reach certain threshold, then we want to
* validate clients.
*/
- if (hdr.token == NULL) {
- port_send_retry(port, &e->peer, &hdr);
- goto undesirable;
- } else if (port_validate_token(&hdr, port, &e->peer, &odcid, &scid) != 1) {
- goto undesirable;
+ if (port->validate_addr == 1) {
+ if (hdr.token == NULL) {
+ port_send_retry(port, &e->peer, &hdr);
+ goto undesirable;
+ } else if (port_validate_token(&hdr, port, &e->peer,
+ &odcid, &scid) == 0) {
+ goto undesirable;
+ }
}
port_bind_channel(port, &e->peer, &scid, &hdr.dst_conn_id,
/* Is this port created to support multiple connections? */
unsigned int is_multi_conn : 1;
+ /* Is this port doing server address validation */
+ unsigned int validate_addr : 1;
+
/* Has this port sent any packet of any kind yet? */
unsigned int have_sent_any_pkt : 1;