summaryrefslogtreecommitdiffstats
path: root/src/plugins/linux-cp/lcp_adj.c
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2021-06-24 10:46:19 -0400
committerAlexander Chernavin <achernavin@netgate.com>2021-06-24 10:46:19 -0400
commit959613b5d7fbb8fadcd96853585268ffc33b3593 (patch)
tree6b6da24c45d0efd5897b253c11bfab125393c006 /src/plugins/linux-cp/lcp_adj.c
parent1ef38743fd1499d41cb5e5a6a8e8529fe10393d1 (diff)
linux-cp: stop managing adjacencies for tunnels
Type: fix Outbound packets which arrive on tun/L3 interfaces use a default adjacency for the interface & address family from the corresponding interface pair. However, there are entries in the linux-cp adj table that are created for them. Managing these entries might cause a segfault because the rewrite data might exceed the reserved space for it of 28 bytes in the linux-cp adj key (e.g. in case of GRE IPv6). With this change, stop creating adjacencies for tun/L3 interfaces in the linux-cp adj table and delegating them. Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: I4bcd685860053ab87c65064c182e3ed53fd4fae9
Diffstat (limited to 'src/plugins/linux-cp/lcp_adj.c')
-rw-r--r--src/plugins/linux-cp/lcp_adj.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/linux-cp/lcp_adj.c b/src/plugins/linux-cp/lcp_adj.c
index cbeb91a75a1..bfbc2fec913 100644
--- a/src/plugins/linux-cp/lcp_adj.c
+++ b/src/plugins/linux-cp/lcp_adj.c
@@ -14,6 +14,8 @@
*/
#include <vnet/adj/adj_delegate.h>
+
+#include <linux-cp/lcp_interface.h>
#include <linux-cp/lcp_adj.h>
#include <vppinfra/bihash_32_8.h>
@@ -133,9 +135,19 @@ lcp_adj_delegate_adj_created (adj_index_t ai)
lcp_adj_kv_t kv;
index_t lai = INDEX_INVALID;
lcp_adj_key_t *adj_key;
+ index_t lipi;
+ lcp_itf_pair_t *lip;
adj = adj_get (ai);
+ lipi = lcp_itf_pair_find_by_phy (adj->rewrite_header.sw_if_index);
+ if (lipi == INDEX_INVALID)
+ return;
+
+ lip = lcp_itf_pair_get (lipi);
+ if (lip->lip_host_type == LCP_ITF_HOST_TUN)
+ return;
+
if (IP_LOOKUP_NEXT_REWRITE == adj->lookup_next_index)
{
lcp_adj_mk_key_adj (adj, &kv.k);