Jose Celano
Jose Celano
hi @WarmBeer, I do not understand the requirements for the UDP tracker connection ID. ```rust pub fn get_connection_id(remote_address: &SocketAddr) -> ConnectionId { match std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH) { Ok(duration) => ConnectionId(((duration.as_secs() / 3600)...
> ```rust > pub fn get_connection_id(remote_address: &SocketAddr) -> ConnectionId { > match std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH) { > Ok(duration) => ConnectionId(((duration.as_secs() / 3600) | ((remote_address.port() as u64) Err(_) => ConnectionId(0x7FFFFFFFFFFFFFFF), > } >...
> ```rust > pub fn get_connection_id(remote_address: &SocketAddr) -> ConnectionId { > match std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH) { > Ok(duration) => ConnectionId(((duration.as_secs() / 3600) | ((remote_address.port() as u64) Err(_) => ConnectionId(0x7FFFFFFFFFFFFFFF), > } >...
It seems the current implementation for the `get_connection_id` could be valid after all. Long explanation: https://github.com/torrust/torrust-tracker/issues/62#issuecomment-1212077204 If that is the case I will continue adding tests to it and an...
@WarmBeer I think we could move the function `get_connection_id` from the `src/protocol/utils.rs` to the `src/udp/handlers.rs` module because the connection ID is only used by the UDP tracker, isn't it?
hi @WarmBeer @da2ce7, I have fixed the tests and created new ones for the connection id generation: ``` PASS [ 0.018s] torrust-tracker protocol::utils::tests::connection_id_in_udp_tracker_should_be_different_for_each_client_at_the_same_time_if_they_use_a_different_port PASS [ 0.012s] torrust-tracker protocol::utils::tests::connection_id_in_udp_tracker_should_be_the_same_for_one_client_during_one_hour PASS [...
hi @WarmBeer, I've been thinking again about your solution, and I do not know if adding a hash increases security. In the previous implementations, you have 10000 possible connections ids...
> > hi @WarmBeer, I've been thinking again about your solution, and I do not know if adding a hash increases security. In the previous implementations, you have 10000 possible...
> @josecelano > > > Yes, but if we add the IP to that implementation instead of using only the port we could solve that problem. > > The formula...