From 85362a85352f4af92be9f8500bc628c1b20d95ca Mon Sep 17 00:00:00 2001 From: Praveen K V Date: Tue, 7 Jul 2015 23:35:08 +0530 Subject: [PATCH] Handle SG-ID update in route for dest-ip Fix a bug in method RouteFlowKey::FlowDestMatch where source_plen is used in place of dest_plen Change-Id: I97918e91c95767b7b428e0bbd0b6440440a461ce Closes-Bug: #1471933 --- src/vnsw/agent/pkt/flow_table.cc | 2 +- src/vnsw/agent/pkt/test/test_sg_flow.cc | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vnsw/agent/pkt/flow_table.cc b/src/vnsw/agent/pkt/flow_table.cc index 28e6087aa2a..a7a2c674b5d 100644 --- a/src/vnsw/agent/pkt/flow_table.cc +++ b/src/vnsw/agent/pkt/flow_table.cc @@ -1987,7 +1987,7 @@ bool RouteFlowKey::FlowDestMatch(const FlowEntry *flow) const { return (flow->data().dmac == mac); } - if (flow->data().source_plen != plen || + if (flow->data().dest_plen != plen || flow->key().family != family) return false; diff --git a/src/vnsw/agent/pkt/test/test_sg_flow.cc b/src/vnsw/agent/pkt/test/test_sg_flow.cc index 4a48f4d7837..ef048503dc4 100644 --- a/src/vnsw/agent/pkt/test/test_sg_flow.cc +++ b/src/vnsw/agent/pkt/test/test_sg_flow.cc @@ -472,6 +472,15 @@ bool sg_introspec_test = false; static void SgListResponse(Sandesh *sandesh, int id, int sg_id, int num_entries) { SgListResp *resp = dynamic_cast(sandesh); + if (resp == NULL) { + Pagination *page = dynamic_cast(sandesh); + if (page != NULL) { + return; + } + sg_introspec_test = false; + return; + } + EXPECT_EQ(resp->get_sg_list().size(), num_entries); if (!sg_id) { EXPECT_EQ(resp->get_sg_list()[0].sg_uuid, UuidToString(MakeUuid(id)));