From 3a0faa68396d1a95b3498590f5dd024968518eb7 Mon Sep 17 00:00:00 2001 From: Ravi BK Date: Wed, 8 Mar 2017 16:28:29 +0530 Subject: [PATCH] Fixing invalid message received in nh --get o/p Skipping sub-nh expansion for composite nh case if the index is -1 in nh utility. Change-Id: If6ef6424a67f96478d8cb740479728754b0d431f Closes-Bug: #1670820 --- utils/nh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/nh.c b/utils/nh.c index 7f460a0f9..773c9dd8b 100644 --- a/utils/nh.c +++ b/utils/nh.c @@ -372,6 +372,9 @@ vr_nexthop_req_process(void *s_req) if (command == SANDESH_OP_GET) { if (req->nhr_type == NH_COMPOSITE) { for (i = 0; i < req->nhr_nh_list_size; i++) { + // Skip expanding sub-nh for -1 index + if (req->nhr_nh_list[i] == -1) + continue; vr_nh_op(cl, command, type, req->nhr_nh_list[i], if_id, vrf_id, dst_mac, src_mac, sip, dip, flags); }