mirror of
https://github.com/ipxe/ipxe
synced 2026-05-09 18:00:12 +03:00
[retry] Hold reference while timer is running and during expiry callback
Guarantee that a retry timer cannot go out of scope while the timer is running, and provide a guarantee to the expiry callback that the timer will remain in scope during the entire callback (similar to the guarantee provided to interface methods). Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
+2
-2
@@ -265,8 +265,8 @@ static int tcp_open ( struct interface *xfer, struct sockaddr *peer,
|
||||
DBGC ( tcp, "TCP %p allocated\n", tcp );
|
||||
ref_init ( &tcp->refcnt, NULL );
|
||||
intf_init ( &tcp->xfer, &tcp_xfer_desc, &tcp->refcnt );
|
||||
timer_init ( &tcp->timer, tcp_expired );
|
||||
timer_init ( &tcp->wait, tcp_wait_expired );
|
||||
timer_init ( &tcp->timer, tcp_expired, &tcp->refcnt );
|
||||
timer_init ( &tcp->wait, tcp_wait_expired, &tcp->refcnt );
|
||||
tcp->prev_tcp_state = TCP_CLOSED;
|
||||
tcp->tcp_state = TCP_STATE_SENT ( TCP_SYN );
|
||||
tcp_dump_state ( tcp );
|
||||
|
||||
Reference in New Issue
Block a user