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.
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),