From: Stanislav Zaikin Date: Thu, 2 Feb 2023 08:54:17 +0000 (+0100) Subject: linux-cp: fix auto-sub-int X-Git-Tag: v23.10-rc0~272 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=9b02f72fedfdce4dbd64539cb41870347eb67d1d;p=vpp.git linux-cp: fix auto-sub-int lcp_itf_pair_pool could grew during sub-interface creation. Type: fix Signed-off-by: Stanislav Zaikin Change-Id: Ideafe392f9bb2b418ce9d6faa4f08dfe26f4a273 --- diff --git a/src/plugins/linux-cp/lcp_interface_sync.c b/src/plugins/linux-cp/lcp_interface_sync.c index 57a8e557379..bd26ebbc354 100644 --- a/src/plugins/linux-cp/lcp_interface_sync.c +++ b/src/plugins/linux-cp/lcp_interface_sync.c @@ -389,7 +389,7 @@ lcp_itf_interface_add_del (vnet_main_t *vnm, u32 sw_if_index, u32 is_create) if (!sup_lip) return NULL; - name = format (name, "%s.%d", sup_lip->lip_host_name, sw->sub.id); + name = format (name, "%s.%d%c", sup_lip->lip_host_name, sw->sub.id, 0); LCP_ITF_PAIR_INFO ( "interface_%s: %U has parent %U, auto-creating LCP with host-if %s", diff --git a/src/plugins/linux-cp/lcp_router.c b/src/plugins/linux-cp/lcp_router.c index ab8ab164972..01eca9f2011 100644 --- a/src/plugins/linux-cp/lcp_router.c +++ b/src/plugins/linux-cp/lcp_router.c @@ -419,6 +419,10 @@ lcp_router_link_add (struct rtnl_link *rl, void *ctx) lip->lip_phy_sw_if_index); return; } + + /* pool could grow during the previous operation */ + lip = lcp_itf_pair_get (lipi); + /* create the vlan interface on the parent host */ if (vnet_create_sub_interface (lip->lip_host_sw_if_index, vlan, 18, 0, vlan, &sub_host_sw_if_index))