From de5c01280ed40274e02c6f2ed7ef13c49d7f9762 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Thu, 12 Aug 2021 12:58:31 +0200 Subject: [PATCH] Refuse to create an LCP for sub-interfaces that does not have exact-match set --- lcpng_interface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lcpng_interface.c b/lcpng_interface.c index 5edc7a3..033c0b3 100644 --- a/lcpng_interface.c +++ b/lcpng_interface.c @@ -655,6 +655,11 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name, u16 outer_vlan, inner_vlan; u16 outer_proto, inner_proto; + if (sw->type == VNET_SW_INTERFACE_TYPE_SUB && sw->sub.eth.flags.exact_match == 0) { + LCP_ITF_PAIR_ERR ("pair_create: can't create LCP for a sub-interface without exact-match set"); + return VNET_API_ERROR_INVALID_ARGUMENT; + } + /* * Find the parent tap by finding the pair from the parent phy */