Explorar el Código

[retry] Use start_timer_fixed() instead of direct timeout manipulation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown hace 14 años
padre
commit
5fa6775b61
Se han modificado 2 ficheros con 2 adiciones y 4 borrados
  1. 1
    2
      src/net/ipv4.c
  2. 1
    2
      src/net/tcp.c

+ 1
- 2
src/net/ipv4.c Ver fichero

@@ -225,8 +225,7 @@ static struct io_buffer * ipv4_reassemble ( struct io_buffer * iobuf ) {
225 225
 
226 226
 		/* Set the reassembly timer */
227 227
 		timer_init ( &fragbuf->frag_timer, ipv4_frag_expired );
228
-		fragbuf->frag_timer.timeout = IP_FRAG_TIMEOUT;
229
-		start_timer ( &fragbuf->frag_timer );
228
+		start_timer_fixed ( &fragbuf->frag_timer, IP_FRAG_TIMEOUT );
230 229
 
231 230
 		/* Add the fragment buffer to the list of fragment buffers */
232 231
 		list_add ( &fragbuf->list, &frag_buffers );

+ 1
- 2
src/net/tcp.c Ver fichero

@@ -1016,8 +1016,7 @@ static int tcp_rx ( struct io_buffer *iobuf,
1016 1016
 	 * timer to expire and cause the connection to be freed.
1017 1017
 	 */
1018 1018
 	if ( TCP_CLOSED_GRACEFULLY ( tcp->tcp_state ) ) {
1019
-		tcp->timer.timeout = ( 2 * TCP_MSL );
1020
-		start_timer ( &tcp->timer );
1019
+		start_timer_fixed ( &tcp->timer, ( 2 * TCP_MSL ) );
1021 1020
 	}
1022 1021
 
1023 1022
 	return 0;

Loading…
Cancelar
Guardar