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
*/
#include <vnet/adj/adj_delegate.h>
+
+#include <linux-cp/lcp_interface.h>
#include <linux-cp/lcp_adj.h>
#include <vppinfra/bihash_32_8.h>
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);