aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorfanyf <fanyufei521@outlook.com>2020-09-17 22:10:41 +0800
committerFlorin Coras <florin.coras@gmail.com>2020-09-18 14:49:11 +0000
commitb8b6fe4fcc9202b6811b90af8ac8f361dfff26bf (patch)
tree27372250ee52ef24bed75810e0bea8c170931cb6 /src/vnet/session
parent4c4633cad1019d9aa28669ddfedc612f768d71a8 (diff)
session: fix vpp exit abnormal due to application as a proxy server with ldp
Type: fix The function of application_setup_proxy() be called when application run as a proxy server, "app_wrk->first_segment_manager" be realloced in this function, but variable of "sm" point original memory location. Signed-off-by: fanyf <fanyufei521@outlook.com> Change-Id: I753c9fb60d1c0794d5eede9f3fab48381a802e3c
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 65d2f08ddca..a0ddaed90cf 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -874,7 +874,15 @@ vnet_application_attach (vnet_app_attach_args_t * a)
fs = segment_manager_get_segment_w_lock (sm, 0);
if (application_is_proxy (app))
- application_setup_proxy (app);
+ {
+ application_setup_proxy (app);
+ /*
+ * I suspect the segment manager pool gets reallocated (because a new listener
+ * is added, and each listener has a segment manager) so sm becomes a dangling
+ * reference. That's why we need to re-grab sm.
+ */
+ sm = segment_manager_get (app_wrk->first_segment_manager);
+ }
ASSERT (vec_len (fs->ssvm.name) <= 128);
a->segment = &fs->ssvm;