MINOR: peers: store the pointer to the signal handler
We'll need it to unregister stopped peers sections.
(cherry picked from commit aa729784e1c0a6a9ac003210d01c605962110522)
diff --git a/include/types/peers.h b/include/types/peers.h
index d52dc8c..b2d4566 100644
--- a/include/types/peers.h
+++ b/include/types/peers.h
@@ -56,6 +56,7 @@
struct shared_table {
struct stktable *table; /* stick table to sync */
struct task *sync_task; /* main sync task */
+ struct sig_handler *sighandler; /* signal handler */
struct peer_session *local_session; /* local peer session */
struct peer_session *sessions; /* peer sessions list */
unsigned int flags; /* current table resync state */
diff --git a/src/peers.c b/src/peers.c
index 159f0a4..97cbcac 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -1524,8 +1524,8 @@
st->sync_task->process = process_peer_sync;
st->sync_task->expire = TICK_ETERNITY;
st->sync_task->context = (void *)st;
- table->sync_task =st->sync_task;
- signal_register_task(0, table->sync_task, 0);
+ table->sync_task = st->sync_task;
+ st->sighandler = signal_register_task(0, table->sync_task, 0);
task_wakeup(st->sync_task, TASK_WOKEN_INIT);
}