From 7ce3dc748e6ea3bf5dc5b5238aa092c2fce3c31b Mon Sep 17 00:00:00 2001 From: Ravi BK Date: Tue, 21 Mar 2017 13:52:20 +0530 Subject: [PATCH] Cherry-pick of 29438 to R3.1 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: I2bb90d7b1ff16beb088f928ead3e4a6d84f5537d Closes-Bug: #1670820 --- utils/nh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/nh.c b/utils/nh.c index 5bdafd871..5150ac0a6 100644 --- a/utils/nh.c +++ b/utils/nh.c @@ -292,6 +292,9 @@ vr_nexthop_req_process(void *s_req) printf("\n\n"); if (req->nhr_type == NH_COMPOSITE && command == SANDESH_OP_GET) { 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); }