/* If 'struct flow' gets additional metadata, we'll need to zero it out
* before traversing a patch port. */
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 21);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 22);
if (!xport) {
xlate_report(ctx, "Nonexistent output port");
pin->up.packet = ofpbuf_steal_data(packet);
pin->up.reason = reason;
pin->up.table_id = ctx->table_id;
- pin->up.cookie = ctx->rule ? rule_dpif_get_flow_cookie(ctx->rule) : 0;
+ pin->up.cookie = (ctx->rule
+ ? rule_dpif_get_flow_cookie(ctx->rule)
+ : OVS_BE64_MAX);
- pin->up.send_len = len;
flow_get_metadata(&ctx->xin->flow, &pin->up.fmd);
pin->controller_id = controller_id;
+ pin->send_len = len;
+ pin->generated_by_table_miss = (ctx->rule
+ && rule_dpif_is_table_miss(ctx->rule));
ofproto_dpif_send_packet_in(ctx->xbridge->ofproto, pin);
ofpbuf_delete(packet);
}
}
break;
- case OFPACT_SET_IPV4_DSCP:
- /* OpenFlow 1.0 only supports IPv4. */
- if (flow->dl_type == htons(ETH_TYPE_IP)) {
+ case OFPACT_SET_IP_DSCP:
+ if (is_ip_any(flow)) {
wc->masks.nw_tos |= IP_DSCP_MASK;
flow->nw_tos &= ~IP_DSCP_MASK;
- flow->nw_tos |= ofpact_get_SET_IPV4_DSCP(a)->dscp;
+ flow->nw_tos |= ofpact_get_SET_IP_DSCP(a)->dscp;
+ }
+ break;
+
+ case OFPACT_SET_IP_ECN:
+ if (is_ip_any(flow)) {
+ wc->masks.nw_tos |= IP_ECN_MASK;
+ flow->nw_tos &= ~IP_ECN_MASK;
+ flow->nw_tos |= ofpact_get_SET_IP_ECN(a)->ecn;
+ }
+ break;
+
+ case OFPACT_SET_IP_TTL:
+ if (is_ip_any(flow)) {
+ wc->masks.nw_ttl = 0xff;
+ flow->nw_ttl = ofpact_get_SET_IP_TTL(a)->ttl;
}
break;
void
xlate_in_init(struct xlate_in *xin, struct ofproto_dpif *ofproto,
const struct flow *flow, struct rule_dpif *rule,
- uint8_t tcp_flags, const struct ofpbuf *packet)
+ uint16_t tcp_flags, const struct ofpbuf *packet)
{
xin->ofproto = ofproto;
xin->flow = *flow;
}
ctx.rule = rule;
}
- xout->fail_open = ctx.rule && rule_dpif_fail_open(ctx.rule);
+ xout->fail_open = ctx.rule && rule_dpif_is_fail_open(ctx.rule);
if (xin->ofpacts) {
ofpacts = xin->ofpacts;