Make sure that repeated NAT challenge responses do not result in zeroed addresses.
@@ -3327,6 +3327,7 @@ uint8_t* picoquic_decode_path_response_frame(picoquic_cnx_t* cnx, uint8_t* bytes
}
}
if (found_challenge) {
+ if (cnx->path[i]->alt_challenge_required) {
/* Promote the alt address to valid address */
cnx->path[i]->peer_addr_len = picoquic_store_addr(&cnx->path[i]->peer_addr, (struct sockaddr*) & cnx->path[i]->alt_peer_addr);
cnx->path[i]->local_addr_len = picoquic_store_addr(&cnx->path[i]->local_addr, (struct sockaddr*) & cnx->path[i]->alt_local_addr);
@@ -3341,7 +3342,10 @@ uint8_t* picoquic_decode_path_response_frame(picoquic_cnx_t* cnx, uint8_t* bytes
cnx->path[i]->alt_challenge_required = 0;
cnx->path[i]->alt_response_required = 0;
cnx->path[i]->alt_challenge_response = 0;
-
+ }
+ else {
+ DBG_PRINTF("Repeated challenge: %16llx\n", (unsigned long long)response);
+ }
break;
}
}
