summaryrefslogtreecommitdiffstats
path: root/src/net/udp/slam.c
diff options
context:
space:
mode:
authorMichael Brown2010-09-02 04:34:04 +0200
committerMichael Brown2010-09-03 22:28:43 +0200
commit28934eef81b3c7a494b12cb87804098041d64659 (patch)
treeda46f478f9977bca4c06f5e71dc37a0066948237 /src/net/udp/slam.c
parent[process] Add process_running() (diff)
downloadipxe-28934eef81b3c7a494b12cb87804098041d64659.tar.gz
ipxe-28934eef81b3c7a494b12cb87804098041d64659.tar.xz
ipxe-28934eef81b3c7a494b12cb87804098041d64659.zip
[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>
Diffstat (limited to 'src/net/udp/slam.c')
-rw-r--r--src/net/udp/slam.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net/udp/slam.c b/src/net/udp/slam.c
index 026bc179..0de138cd 100644
--- a/src/net/udp/slam.c
+++ b/src/net/udp/slam.c
@@ -695,8 +695,10 @@ static int slam_open ( struct interface *xfer, struct uri *uri ) {
intf_init ( &slam->xfer, &slam_xfer_desc, &slam->refcnt );
intf_init ( &slam->socket, &slam_socket_desc, &slam->refcnt );
intf_init ( &slam->mc_socket, &slam_mc_socket_desc, &slam->refcnt );
- timer_init ( &slam->master_timer, slam_master_timer_expired );
- timer_init ( &slam->slave_timer, slam_slave_timer_expired );
+ timer_init ( &slam->master_timer, slam_master_timer_expired,
+ &slam->refcnt );
+ timer_init ( &slam->slave_timer, slam_slave_timer_expired,
+ &slam->refcnt );
/* Fake an invalid cached header of { 0x00, ... } */
slam->header_len = 1;
/* Fake parameters for initial NACK */