summaryrefslogtreecommitdiff
path: root/zebra/zebra_mlag_private.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2022-02-24 01:43:48 -0500
committerGitHub <noreply@github.com>2022-02-24 01:43:48 -0500
commit7bf63db79b7848b73e1cef49f3496038644bea16 (patch)
tree2c95921d910689673348e60f9614de7d9d00c4e7 /zebra/zebra_mlag_private.c
parentca6c97340b013e140c0cb31737858f7c672b7dfb (diff)
parentcc9f21da2218d95567eff1501482ce58e6600f54 (diff)
Merge pull request #10632 from donaldsharp/thread_return_null
*: Change thread->func to return void instead of int
Diffstat (limited to 'zebra/zebra_mlag_private.c')
-rw-r--r--zebra/zebra_mlag_private.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/zebra/zebra_mlag_private.c b/zebra/zebra_mlag_private.c
index b1bba831d2..50a290b9e8 100644
--- a/zebra/zebra_mlag_private.c
+++ b/zebra/zebra_mlag_private.c
@@ -48,8 +48,8 @@
static struct thread_master *zmlag_master;
static int mlag_socket;
-static int zebra_mlag_connect(struct thread *thread);
-static int zebra_mlag_read(struct thread *thread);
+static void zebra_mlag_connect(struct thread *thread);
+static void zebra_mlag_read(struct thread *thread);
/*
* Write the data to MLAGD
@@ -72,7 +72,7 @@ static void zebra_mlag_sched_read(void)
&zrouter.mlag_info.t_read);
}
-static int zebra_mlag_read(struct thread *thread)
+static void zebra_mlag_read(struct thread *thread)
{
static uint32_t mlag_rd_buf_offset;
uint32_t *msglen;
@@ -98,13 +98,13 @@ static int zebra_mlag_read(struct thread *thread)
mlag_socket);
close(mlag_socket);
zebra_mlag_handle_process_state(MLAG_DOWN);
- return -1;
+ return;
}
mlag_rd_buf_offset += data_len;
if (data_len != (ssize_t)(ZEBRA_MLAG_LEN_SIZE - curr_len)) {
/* Try again later */
zebra_mlag_sched_read();
- return 0;
+ return;
}
curr_len = ZEBRA_MLAG_LEN_SIZE;
}
@@ -136,13 +136,13 @@ static int zebra_mlag_read(struct thread *thread)
mlag_socket);
close(mlag_socket);
zebra_mlag_handle_process_state(MLAG_DOWN);
- return -1;
+ return;
}
mlag_rd_buf_offset += data_len;
if (data_len != (ssize_t)(tot_len - curr_len)) {
/* Try again later */
zebra_mlag_sched_read();
- return 0;
+ return;
}
}
@@ -162,10 +162,9 @@ static int zebra_mlag_read(struct thread *thread)
zebra_mlag_reset_read_buffer();
mlag_rd_buf_offset = 0;
zebra_mlag_sched_read();
- return 0;
}
-static int zebra_mlag_connect(struct thread *thread)
+static void zebra_mlag_connect(struct thread *thread)
{
struct sockaddr_un svr = {0};
@@ -178,7 +177,7 @@ static int zebra_mlag_connect(struct thread *thread)
mlag_socket = socket(svr.sun_family, SOCK_STREAM, 0);
if (mlag_socket < 0)
- return -1;
+ return;
if (connect(mlag_socket, (struct sockaddr *)&svr, sizeof(svr)) == -1) {
if (IS_ZEBRA_DEBUG_MLAG)
@@ -189,7 +188,7 @@ static int zebra_mlag_connect(struct thread *thread)
zrouter.mlag_info.timer_running = true;
thread_add_timer(zmlag_master, zebra_mlag_connect, NULL, 10,
&zrouter.mlag_info.t_read);
- return 0;
+ return;
}
set_nonblocking(mlag_socket);
@@ -204,7 +203,6 @@ static int zebra_mlag_connect(struct thread *thread)
* Connection is established with MLAGD, post to clients
*/
zebra_mlag_handle_process_state(MLAG_UP);
- return 0;
}
/*