diff --git a/utils/mpls.c b/utils/mpls.c index 93cdbd92d..5455339cd 100644 --- a/utils/mpls.c +++ b/utils/mpls.c @@ -56,7 +56,10 @@ vr_mpls_req_process(void *s_req) if (mpls_op == SANDESH_OP_DUMP) dump_marker = req->mr_label; - response_pending = false; + if (mpls_op != SANDESH_OP_DUMP) + response_pending = false; + + return; } void @@ -143,6 +146,8 @@ vr_mpls_op(void) if (resp->nl_op == SANDESH_REQUEST) { sandesh_decode(resp->nl_data, resp->nl_len, vr_find_sandesh_info, &ret); + } else if (resp->nl_type == NL_MSG_TYPE_DONE) { + response_pending = false; } } diff --git a/utils/nh.c b/utils/nh.c index dd79c9304..1889366f7 100644 --- a/utils/nh.c +++ b/utils/nh.c @@ -249,7 +249,8 @@ vr_nexthop_req_process(void *s_req) dump_marker = req->nhr_id; } - response_pending = false; + if (command != 3) + response_pending = false; printf("\n"); } @@ -386,6 +387,8 @@ vr_nh_op(int opt, int mode, uint32_t nh_id, uint32_t if_id, uint32_t vrf_id, resp = nl_parse_reply(cl); if (resp->nl_op == SANDESH_REQUEST) { sandesh_decode(resp->nl_data, resp->nl_len, vr_find_sandesh_info, &ret); + } else if (resp->nl_type == NL_MSG_TYPE_DONE) { + response_pending = false; } } diff --git a/utils/rt.c b/utils/rt.c index 33f0c2d51..25f0967e5 100644 --- a/utils/rt.c +++ b/utils/rt.c @@ -241,7 +241,9 @@ vr_route_req_process(void *s_req) printf(" %10d\n", rt->rtr_nh_id); } - response_pending = false; + if (cmd_op != SANDESH_OP_DUMP) + response_pending = false; + return; } @@ -406,9 +408,12 @@ vr_send_one_message(void) while (response_pending) { if ((ret = nl_recvmsg(cl)) > 0) { resp = nl_parse_reply(cl); - if (resp->nl_op == SANDESH_REQUEST) + if (resp->nl_op == SANDESH_REQUEST) { sandesh_decode(resp->nl_data, resp->nl_len, vr_find_sandesh_info, &ret); + } else if (resp->nl_type == NL_MSG_TYPE_DONE) { + response_pending = false; + } } } return resp_code; diff --git a/utils/vif.c b/utils/vif.c index 770baed21..29aca67dd 100644 --- a/utils/vif.c +++ b/utils/vif.c @@ -343,7 +343,9 @@ vr_interface_req_process(void *s) vr_ifindex = req->vifr_idx; } - response_pending = false; + if (vr_op != SANDESH_OP_DUMP) + response_pending = false; + return; } @@ -494,6 +496,8 @@ vr_intf_send_msg(void *request, char *request_string) if (resp->nl_op == SANDESH_REQUEST) { sandesh_decode(resp->nl_data, resp->nl_len, vr_find_sandesh_info, &ret); + } else if (resp->nl_type == NL_MSG_TYPE_DONE) { + response_pending = false; } } diff --git a/utils/vxlan.c b/utils/vxlan.c index 26d22f330..265cf4bab 100644 --- a/utils/vxlan.c +++ b/utils/vxlan.c @@ -61,7 +61,8 @@ vr_vxlan_req_process(void *s_req) dump_marker = req->vxlanr_vnid; - response_pending = false; + if (vxlan_op != SANDESH_OP_DUMP) + response_pending = false; return; } @@ -151,6 +152,8 @@ vr_vxlan_op(void) if (resp->nl_op == SANDESH_REQUEST) { sandesh_decode(resp->nl_data, resp->nl_len, vr_find_sandesh_info, &ret); + } else if (resp->nl_type == NL_MSG_TYPE_DONE) { + response_pending = false; } }