/* Extract flow data from 'opi' into 'flow'. */
ofpbuf_use_const(&pkt, pi.packet, pi.packet_len);
- flow_extract(&pkt, 0, pi.fmd.tun_id, pi.fmd.in_port, &flow);
+ flow_extract(&pkt, 0, NULL, pi.fmd.in_port, &flow);
+ flow.tunnel.tun_id = pi.fmd.tun_id;
/* Choose output port. */
out_port = lswitch_choose_destination(sw, &flow);
/* The output port is known, or we always flood everything, so add a
* new flow. */
memset(&fm, 0, sizeof fm);
- cls_rule_init(&flow, &sw->wc, 0, &fm.cr);
- ofputil_normalize_rule_quiet(&fm.cr);
+ match_init(&fm.match, &flow, &sw->wc);
+ ofputil_normalize_match_quiet(&fm.match);
+ fm.priority = 0;
fm.table_id = 0xff;
fm.command = OFPFC_ADD;
fm.idle_timeout = sw->max_idle;
/* If the switch didn't buffer the packet, we need to send a copy. */
if (pi.buffer_id == UINT32_MAX && out_port != OFPP_NONE) {
- queue_tx(sw, ofputil_encode_packet_out(&po));
+ queue_tx(sw, ofputil_encode_packet_out(&po, sw->protocol));
}
} else {
/* We don't know that MAC, or we don't set up flows. Send along the
* packet without setting up a flow. */
if (pi.buffer_id != UINT32_MAX || out_port != OFPP_NONE) {
- queue_tx(sw, ofputil_encode_packet_out(&po));
+ queue_tx(sw, ofputil_encode_packet_out(&po, sw->protocol));
}
}
}