{
struct ofputil_switch_features features;
struct ofputil_phy_port port;
- enum ofperr error;
- struct ofpbuf b;
- error = ofputil_decode_switch_features(oh, &features, &b);
+ struct ofpbuf b = ofpbuf_const_initializer(oh, ntohs(oh->length));
+ enum ofperr error = ofputil_pull_switch_features(&b, &features);
if (error) {
VLOG_ERR("received invalid switch feature reply (%s)",
ofperr_to_string(error));
process_packet_in(struct lswitch *sw, const struct ofp_header *oh)
{
struct ofputil_packet_in pi;
- size_t total_len;
uint32_t buffer_id;
uint32_t queue_id;
ofp_port_t out_port;
struct dp_packet pkt;
struct flow flow;
- error = ofputil_decode_packet_in(oh, &pi, &total_len, &buffer_id);
+ error = ofputil_decode_packet_in(oh, true, &pi, NULL, &buffer_id, NULL);
if (error) {
VLOG_WARN_RL(&rl, "failed to decode packet-in: %s",
ofperr_to_string(error));
}
/* Extract flow data from 'pi' into 'flow'. */
- dp_packet_use_const(&pkt, pi.packet, pi.len);
+ dp_packet_use_const(&pkt, pi.packet, pi.packet_len);
flow_extract(&pkt, &flow);
flow.in_port.ofp_port = pi.flow_metadata.flow.in_port.ofp_port;
flow.tunnel.tun_id = pi.flow_metadata.flow.tunnel.tun_id;