From 57fb2fe3783f534b3c530f565d21b348c253a158 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 8 Aug 2008 15:39:20 -0700 Subject: [PATCH] Set up flow to drop packets that come in on their output port. Commit 0a3d4ba3a, "Don't allow the learning switch to send packets back out the incoming port," drops packets that come in on their incoming port, but it does not set up a flow to drop those packets. If we are connected to a hub, then this can be very expensive, since we can continue to get many packets in that flow and have to drop them in secchan one by one. So now we set up a flow to drop them for us. --- lib/learning-switch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/learning-switch.c b/lib/learning-switch.c index e3b4df5d..0dfdeae5 100644 --- a/lib/learning-switch.c +++ b/lib/learning-switch.c @@ -224,9 +224,9 @@ process_packet_in(struct lswitch *sw, struct rconn *rconn, } if (in_port == out_port) { - /* The input port and output port match, so just drop the packet - * by returning. */ - return; + /* The input and output port match. Set up a flow to drop packets. */ + queue_tx(sw, rconn, make_add_flow(&flow, ntohl(opi->buffer_id), + sw->max_idle, 0)); } else if (sw->max_idle >= 0 && (!sw->ml || out_port != OFPP_FLOOD)) { /* The output port is known, or we always flood everything, so add a * new flow. */ -- 2.30.2