2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

ofp-errors: Use OFPERR_OFPBRC_BAD_PORT

* In the case of OpenFlow 1.2+ OFPERR_OFPBRC_BAD_PORT is defined
  in the specification and seems to be the most appropriate error
  to use when an invalid port is encountered in a Packet Out request.

* In the case of OpenFlow 1.0 and 1.1 no appropriate error message
  seems to exist. Perhaps because an invalid port is not possible?
  I'm unsure.

  In any case, make use of a non-standard error code (1,514).
  This was formerly known as OFPERR_NXBRC_BAD_IN_PORT but
  has been rolled into OFPERR_NXBRC_BAD_IN_PORT to allow the
  latter to be used without concern for the prevailing Open Flow version.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Simon Horman
2012-09-05 11:50:37 +09:00
committed by Ben Pfaff
parent 55c2b94431
commit 2e1bfcb631
4 changed files with 7 additions and 12 deletions

View File

@@ -2279,7 +2279,6 @@ ofputil_decode_packet_out(struct ofputil_packet_out *po,
const struct ofp_header *oh,
struct ofpbuf *ofpacts)
{
enum ofperr bad_in_port_err;
enum ofpraw raw;
struct ofpbuf b;
@@ -2301,8 +2300,6 @@ ofputil_decode_packet_out(struct ofputil_packet_out *po,
if (error) {
return error;
}
bad_in_port_err = OFPERR_OFPBMC_BAD_VALUE;
} else if (raw == OFPRAW_OFPT10_PACKET_OUT) {
enum ofperr error;
const struct ofp_packet_out *opo = ofpbuf_pull(&b, sizeof *opo);
@@ -2314,8 +2311,6 @@ ofputil_decode_packet_out(struct ofputil_packet_out *po,
if (error) {
return error;
}
bad_in_port_err = OFPERR_NXBRC_BAD_IN_PORT;
} else {
NOT_REACHED();
}
@@ -2324,7 +2319,7 @@ ofputil_decode_packet_out(struct ofputil_packet_out *po,
&& po->in_port != OFPP_NONE && po->in_port != OFPP_CONTROLLER) {
VLOG_WARN_RL(&bad_ofmsg_rl, "packet-out has bad input port %#"PRIx16,
po->in_port);
return bad_in_port_err;
return OFPERR_OFPBRC_BAD_PORT;
}
po->ofpacts = ofpacts->data;