From: Alexander Chernavin Date: Wed, 20 Oct 2021 11:52:46 +0000 (+0000) Subject: linux-cp: make check of message ts null-tolerant X-Git-Tag: v22.10-rc0~329 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=87e92c6586747a790ae514effb79b86a3e53958e;p=vpp.git linux-cp: make check of message ts null-tolerant Type: improvement For some message types, timestamps are checked on netlink message to decide whether the message should be applied. For notification messages timestamps are expected to be always available. With this change, before accessing the timestamp, make sure the message info object that carries it is not null. If it is null, pass the check. This is to be ready to process dump replies that will not need the timestamp check and will have the message info object set to null. Signed-off-by: Alexander Chernavin Change-Id: Ic7211c0d451d72f6a5248898b3a8f8e0bca8f7aa --- diff --git a/src/plugins/linux-cp/lcp_router.c b/src/plugins/linux-cp/lcp_router.c index c70acfff1be..d99de9ca24d 100644 --- a/src/plugins/linux-cp/lcp_router.c +++ b/src/plugins/linux-cp/lcp_router.c @@ -133,6 +133,9 @@ lcp_router_intf_h2p (u32 host) static int lcp_router_lip_ts_check (nl_msg_info_t *msg_info, lcp_itf_pair_t *lip) { + if (!msg_info) + return 0; + if (msg_info->ts > lip->lip_create_ts) return 0;