X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-util.c;h=a4b1f5fc61dcb8c3e761f13c28bd795eb14df23c;hb=6d8ffe18982370d2c46665d7924c340030d53565;hp=b0aeaf4f1acb5e0d8a5d735bb1e8b44f3cb8dc1d;hpb=a877206f2f0ca10c625e311614d68a81bdc913ee;p=sliver-openvswitch.git diff --git a/lib/ofp-util.c b/lib/ofp-util.c index b0aeaf4f1..a4b1f5fc6 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1883,7 +1883,7 @@ make_packet_out(const struct ofpbuf *packet, uint32_t buffer_id, opo->header.length = htons(size); opo->header.xid = htonl(0); opo->buffer_id = htonl(buffer_id); - opo->in_port = htons(in_port == ODPP_LOCAL ? OFPP_LOCAL : in_port); + opo->in_port = htons(in_port == OVSP_LOCAL ? OFPP_LOCAL : in_port); opo->actions_len = htons(actions_len); ofpbuf_put(out, actions, actions_len); if (packet) { @@ -1979,6 +1979,22 @@ check_resubmit_table(const struct nx_action_resubmit *nar) return 0; } +static int +check_output_reg(const struct nx_action_output_reg *naor, + const struct flow *flow) +{ + size_t i; + + for (i = 0; i < sizeof naor->zero; i++) { + if (naor->zero[i]) { + return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT); + } + } + + return nxm_src_check(naor->src, nxm_decode_ofs(naor->ofs_nbits), + nxm_decode_n_bits(naor->ofs_nbits), flow); +} + int validate_actions(const union ofp_action *actions, size_t n_actions, const struct flow *flow, int max_ports) @@ -2057,6 +2073,11 @@ validate_actions(const union ofp_action *actions, size_t n_actions, max_ports, flow); break; + case OFPUTIL_NXAST_OUTPUT_REG: + error = check_output_reg((const struct nx_action_output_reg *) a, + flow); + break; + case OFPUTIL_NXAST_RESUBMIT_TABLE: error = check_resubmit_table( (const struct nx_action_resubmit *) a); @@ -2170,6 +2191,7 @@ ofputil_decode_nxast_action(const union ofp_action *a) NXAST_ACTION(NXAST_BUNDLE, struct nx_action_bundle, true); NXAST_ACTION(NXAST_BUNDLE_LOAD, struct nx_action_bundle, true); NXAST_ACTION(NXAST_RESUBMIT_TABLE, struct nx_action_resubmit, false); + NXAST_ACTION(NXAST_OUTPUT_REG, struct nx_action_output_reg, false); #undef NXAST_ACTION case NXAST_SNAT__OBSOLETE: