From: Gao Feng Date: Mon, 17 Jul 2023 14:19:32 +0000 (+0800) Subject: vcl: Fix the ldp init check X-Git-Tag: v24.02-rc0~89 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=96600f907743729d25be38db292e093279e97d54;p=vpp.git vcl: Fix the ldp init check Maybe some function calls the wrapper funtion like read which invokes the ldp_init_check in the other libs as a constructor before ldp_constructor. Then the ldp has been initialized already when ldp_constructor is invoked. And it's normal case, we shouldn't treat it as an error. So ldp_init should return success if ldp is initialized already instead of an assert. Type: fix Change-Id: Ifa2a7b1d5471981a3f840b14a4fa5d48fb1f1374 Signed-off-by: Gao Feng --- diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c index a8062b4ca8d..cc281b0cae8 100644 --- a/src/vcl/ldp.c +++ b/src/vcl/ldp.c @@ -288,7 +288,11 @@ ldp_init (void) ldp_worker_ctx_t *ldpw; int rv; - ASSERT (!ldp->init); + if (ldp->init) + { + LDBG (0, "LDP is initialized already"); + return 0; + } ldp_init_cfg (); ldp->init = 1;