@@ -637,7 +637,7 @@ fn sanitize_entries(addrs: &[IpAddr], sockets: &[SocketEntry]) -> Result<(), Err
637637
638638// Verifies that the other socket is at QUIC_PORT_OFFSET from the first one.
639639#[ cfg( test) ]
640- pub ( crate ) fn sanitize_quic_offset (
640+ fn sanitize_quic_offset (
641641 socket : & Option < SocketAddr > , // udp
642642 other : & Option < SocketAddr > , // quic: udp + QUIC_PORT_OFFSET
643643) -> Result < ( ) , Error > {
@@ -647,7 +647,7 @@ pub(crate) fn sanitize_quic_offset(
647647}
648648
649649// Returns the socket at QUIC_PORT_OFFSET from the given one.
650- pub ( crate ) fn get_quic_socket ( socket : & SocketAddr ) -> Result < SocketAddr , Error > {
650+ fn get_quic_socket ( socket : & SocketAddr ) -> Result < SocketAddr , Error > {
651651 Ok ( SocketAddr :: new (
652652 socket. ip ( ) ,
653653 socket
@@ -964,34 +964,23 @@ mod tests {
964964 old. serve_repair( Protocol :: UDP ) . unwrap( ) ,
965965 node. serve_repair( Protocol :: UDP ) . unwrap( )
966966 ) ;
967+ assert_eq ! ( old. tpu( ) . unwrap( ) , node. tpu( Protocol :: UDP ) . unwrap( ) ) ;
967968 assert_eq ! (
968- old. tpu( Protocol :: QUIC ) . unwrap( ) ,
969- node. tpu( Protocol :: QUIC ) . unwrap( )
970- ) ;
971- assert_eq ! (
972- old. tpu( Protocol :: UDP ) . unwrap( ) ,
973- node. tpu( Protocol :: UDP ) . unwrap( )
974- ) ;
975- assert_eq ! (
976- old. tpu_forwards( Protocol :: QUIC ) . unwrap( ) ,
977- node. tpu_forwards( Protocol :: QUIC ) . unwrap( )
969+ node. tpu( Protocol :: QUIC ) . unwrap( ) ,
970+ SocketAddr :: new(
971+ old. tpu( ) . unwrap( ) . ip( ) ,
972+ old. tpu( ) . unwrap( ) . port( ) + QUIC_PORT_OFFSET
973+ )
978974 ) ;
979975 assert_eq ! (
980- old. tpu_forwards( Protocol :: UDP ) . unwrap( ) ,
976+ old. tpu_forwards( ) . unwrap( ) ,
981977 node. tpu_forwards( Protocol :: UDP ) . unwrap( )
982978 ) ;
983979 assert_eq ! (
984980 node. tpu_forwards( Protocol :: QUIC ) . unwrap( ) ,
985981 SocketAddr :: new(
986- old. tpu_forwards( Protocol :: UDP ) . unwrap( ) . ip( ) ,
987- old. tpu_forwards( Protocol :: UDP ) . unwrap( ) . port( ) + QUIC_PORT_OFFSET
988- )
989- ) ;
990- assert_eq ! (
991- node. tpu( Protocol :: QUIC ) . unwrap( ) ,
992- SocketAddr :: new(
993- old. tpu( Protocol :: UDP ) . unwrap( ) . ip( ) ,
994- old. tpu( Protocol :: UDP ) . unwrap( ) . port( ) + QUIC_PORT_OFFSET
982+ old. tpu_forwards( ) . unwrap( ) . ip( ) ,
983+ old. tpu_forwards( ) . unwrap( ) . port( ) + QUIC_PORT_OFFSET
995984 )
996985 ) ;
997986 assert_eq ! (
0 commit comments