Don't allow the learning switch to send packets back out the incoming port.

The learning switch functionality included in OpenFlow will send packets
out the port they arrived on if the learned destination is from that port.
This causes problems when newer switches flood packets for destinations they
don't know and OpenFlow reinjects packets back into the network.  The correct
behavior is to just drop the packet.
This commit is contained in:
Justin Pettit
2008-07-29 23:43:58 -07:00
parent 5147d00489
commit 0a3d4ba3a4
+5 -1
View File
@@ -223,7 +223,11 @@ process_packet_in(struct lswitch *sw, struct rconn *rconn,
out_port = mac_learning_lookup(sw->ml, flow.dl_dst);
}
if (sw->max_idle >= 0 && (!sw->ml || out_port != OFPP_FLOOD)) {
if (in_port == out_port) {
/* The input port and output port match, so just drop the packet
* by returning. */
return;
} 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. */
queue_tx(sw, rconn, make_add_simple_flow(&flow, ntohl(opi->buffer_id),