From f1dff7ff4391a73cf53e48f3d821bff96b11ed3b Mon Sep 17 00:00:00 2001 From: Farbod Shahinfar Date: Thu, 27 Aug 2020 21:55:08 +0430 Subject: [PATCH] fix replicate first index gate issue when the first gate of the replicate gates array is not zero the behavior of the code was unexpected. it was emiting packets on gate zero instead of using the gate in the array with zero index. --- CONTRIBUTING.md | 1 + core/modules/replicate.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9ef094d17..491f2aa01 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,3 +64,4 @@ Please add your name to the end of this file and include this file to the PR, un * Brent Stephens * M. Asim Jamshed * Yan Grunenberger +* Farbod Shahinfar diff --git a/core/modules/replicate.cc b/core/modules/replicate.cc index ccf3e8c0a..3c01d1427 100644 --- a/core/modules/replicate.cc +++ b/core/modules/replicate.cc @@ -74,7 +74,7 @@ void Replicate::ProcessBatch(Context *ctx, bess::PacketBatch *batch) { EmitPacket(ctx, newpkt, gates_[j]); } } - EmitPacket(ctx, tocopy, 0); + EmitPacket(ctx, tocopy, gates_[0]); } }