From: Andrew Yourtchenko Date: Tue, 23 Aug 2022 15:38:05 +0000 (+0000) Subject: ethernet: fix coverity 218549 X-Git-Tag: v23.02-rc0~64 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=b46a4e69e5db18ef792415439d04a0ab22c59386;p=vpp.git ethernet: fix coverity 218549 Check that the pointer is non-null before dereferencing it. Type: fix Signed-off-by: Andrew Yourtchenko Change-Id: I611a1042d08bbe455dd09a4fa5711fe86c440240 --- diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c index 214e68809cc..21346a80658 100644 --- a/src/vnet/ethernet/node.c +++ b/src/vnet/ethernet/node.c @@ -225,7 +225,7 @@ identify_subint (ethernet_main_t * em, // A unicast packet arriving on an L3 interface must have a dmac // matching the interface mac. If interface has STATUS_L3 bit set // mac filter is already done. - if (!(*is_l2 || (ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3))) + if (!(*is_l2 || (ei && (ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3)))) { u64 dmacs[2]; u8 dmacs_bad[2];