summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-10-14 14:30:54 +0200
committerGitHub <noreply@github.com>2020-10-14 14:30:54 +0200
commit027b3ca2e0d80f861f940da44ec05b3df4f10cf9 (patch)
tree656377c97a3202f2fcd8357fe23163aa00e5275b /zebra
parentMerge pull request #7283 from donaldsharp/thread_off_semantics (diff)
parentzebra: Isolate mlag_rd_buf_offset to the actual using function (diff)
downloadfrr-027b3ca2e0d80f861f940da44ec05b3df4f10cf9.tar.xz
frr-027b3ca2e0d80f861f940da44ec05b3df4f10cf9.zip
Merge pull request #7244 from donaldsharp/mlag_backout_and_fix
Mlag backout and fix
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_mlag_private.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/zebra/zebra_mlag_private.c b/zebra/zebra_mlag_private.c
index 343e7801d..8a66d6de7 100644
--- a/zebra/zebra_mlag_private.c
+++ b/zebra/zebra_mlag_private.c
@@ -74,9 +74,10 @@ static void zebra_mlag_sched_read(void)
static int zebra_mlag_read(struct thread *thread)
{
+ static uint32_t mlag_rd_buf_offset;
uint32_t *msglen;
uint32_t h_msglen;
- uint32_t tot_len, curr_len = 0;
+ uint32_t tot_len, curr_len = mlag_rd_buf_offset;
/*
* Received message in sock_stream looks like below
@@ -99,6 +100,7 @@ static int zebra_mlag_read(struct thread *thread)
zebra_mlag_handle_process_state(MLAG_DOWN);
return -1;
}
+ mlag_rd_buf_offset += data_len;
if (data_len != (ssize_t)(ZEBRA_MLAG_LEN_SIZE - curr_len)) {
/* Try again later */
zebra_mlag_sched_read();
@@ -136,6 +138,7 @@ static int zebra_mlag_read(struct thread *thread)
zebra_mlag_handle_process_state(MLAG_DOWN);
return -1;
}
+ mlag_rd_buf_offset += data_len;
if (data_len != (ssize_t)(tot_len - curr_len)) {
/* Try again later */
zebra_mlag_sched_read();
@@ -157,6 +160,7 @@ static int zebra_mlag_read(struct thread *thread)
/* Register read thread. */
zebra_mlag_reset_read_buffer();
+ mlag_rd_buf_offset = 0;
zebra_mlag_sched_read();
return 0;
}