[ovs-discuss] [PATCH] ofproto/ofproto-dpif.c don't forward ofp_port == ctx->flow.in_port

Aaron Rosen arosen at clemson.edu
Wed Feb 8 01:22:12 UTC 2012


This patch corrects the behavior when an OFPAT_PACKET_OUT is received
and the in_port is in the output action list. In these cases packets
should not be sent to the corresponding output if it matches the
in_port (i.e just like in the case with action=OFPP_FLOOD, the packet
is not also sent to in_port).

 OFPT_PACKET_OUT (xid=0x0): in_port=LOCAL actions_len=16
actions=output:1,LOCAL data_len=60

This packet is output to ports 1 and LOCAL,but should just output to port 1.



Signed-off-by: Aaron Rosen <arosen at clemson.edu>
 ofproto/ofproto-dpif.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 28f0434..2fe7a8a 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4304,6 +4304,11 @@ compose_output_action__(struct action_xlate_ctx
*ctx, uint16_t ofp_port,
     uint8_t flow_nw_tos = ctx->flow.nw_tos;
     uint16_t out_port;

+    /* If ofp_port equals in_port packet should not be forwarded.
+     * Only output to OFPP_IN_PORT should output to the in_port. */
+    if(ofp_port == ctx->flow.in_port) {
+        return;
+    }
     if (ofport) {
         struct priority_to_dscp *pdscp;


Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel

More information about the discuss mailing list