[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:
+1
-1
@@ -527,7 +527,7 @@ static int dns_resolv ( struct interface *resolv,
|
||||
ref_init ( &dns->refcnt, NULL );
|
||||
intf_init ( &dns->resolv, &dns_resolv_desc, &dns->refcnt );
|
||||
intf_init ( &dns->socket, &dns_socket_desc, &dns->refcnt );
|
||||
timer_init ( &dns->timer, dns_timer_expired );
|
||||
timer_init ( &dns->timer, dns_timer_expired, &dns->refcnt );
|
||||
memcpy ( &dns->sa, sa, sizeof ( dns->sa ) );
|
||||
|
||||
/* Create query */
|
||||
|
||||
Reference in New Issue
Block a user