aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-02-10 15:26:37 -0800
committerFlorin Coras <florin.coras@gmail.com>2021-02-10 23:22:22 +0000
commit1bb74944a385ea1b8f50b975359cb1c7ca94afb4 (patch)
treea56e4bf910d32ef08654c436f41e6baf8406b2b1 /src/vcl/vppcom.c
parent130680b21ea4977ef50d45c9f17c8e70a8a64f54 (diff)
vcl: validate seg handle on migrate only if needed
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c15a465f84f2ceb6bd5f1c459899824d4bc1c90
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index bc83b55d5d0..80f0ad7b202 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -636,12 +636,17 @@ vcl_session_migrated_handler (vcl_worker_t * wrk, void *data)
return;
}
- fs_index = vcl_segment_table_lookup (mp->segment_handle);
- if (fs_index == VCL_INVALID_SEGMENT_INDEX)
+ /* Only validate if a value is provided */
+ if (mp->segment_handle != SESSION_INVALID_HANDLE)
{
- VDBG (0, "segment for session %u is not mounted!", s->session_index);
- s->session_state = VCL_STATE_DETACHED;
- return;
+ fs_index = vcl_segment_table_lookup (mp->segment_handle);
+ if (fs_index == VCL_INVALID_SEGMENT_INDEX)
+ {
+ VDBG (0, "segment %lx for session %u is not mounted!",
+ mp->segment_handle, s->session_index);
+ s->session_state = VCL_STATE_DETACHED;
+ return;
+ }
}
s->vpp_handle = mp->new_handle;