summaryrefslogtreecommitdiffstats
path: root/pimd/pim_msdp_socket.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-05-05 23:22:25 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-05-09 22:44:22 +0200
commit66e78ae64bc4659848517953b365606e3e70e878 (patch)
treeef1339e397feed2b56b8d653d41c03aa5b2bd94f /pimd/pim_msdp_socket.c
parentlib: safely check & set thread pointers (diff)
downloadfrr-66e78ae64bc4659848517953b365606e3e70e878.tar.xz
frr-66e78ae64bc4659848517953b365606e3e70e878.zip
*: update thread_add_* calls
Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_msdp_socket.c')
-rw-r--r--pimd/pim_msdp_socket.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pimd/pim_msdp_socket.c b/pimd/pim_msdp_socket.c
index b09dd635a..8ceddfa39 100644
--- a/pimd/pim_msdp_socket.c
+++ b/pimd/pim_msdp_socket.c
@@ -70,8 +70,9 @@ pim_msdp_sock_accept(struct thread *thread)
zlog_err ("accept_sock is negative value %d", accept_sock);
return -1;
}
- listener->thread = thread_add_read(master, pim_msdp_sock_accept, listener,
- accept_sock, NULL);
+ listener->thread = NULL;
+ thread_add_read(master, pim_msdp_sock_accept, listener, accept_sock,
+ &listener->thread);
/* accept client connection. */
msdp_sock = sockunion_accept(accept_sock, &su);
@@ -173,8 +174,9 @@ pim_msdp_sock_listen(void)
/* add accept thread */
listener->fd = sock;
memcpy(&listener->su, &sin, socklen);
- listener->thread = thread_add_read(msdp->master, pim_msdp_sock_accept,
- listener, sock, NULL);
+ listener->thread = NULL;
+ thread_add_read(msdp->master, pim_msdp_sock_accept, listener, sock,
+ &listener->thread);
msdp->flags |= PIM_MSDPF_LISTENER;
return 0;