mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
ofp-util: Make ofputil_port_from_ofp11() return OFPP_NONE on error.
This makes life easier for a few callers, and it agrees with my usual preference that a function should fill in its output parameters whether it succeeds or not. CC: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -1203,9 +1203,7 @@ mf_set_value(const struct mf_field *mf,
|
||||
|
||||
case MFF_IN_PORT_OXM: {
|
||||
uint16_t port;
|
||||
if (ofputil_port_from_ofp11(value->be32, &port)) {
|
||||
port = OFPP_NONE;
|
||||
}
|
||||
ofputil_port_from_ofp11(value->be32, &port);
|
||||
match_set_in_port(match, port);
|
||||
break;
|
||||
}
|
||||
@@ -1395,9 +1393,7 @@ mf_set_flow_value(const struct mf_field *mf,
|
||||
|
||||
case MFF_IN_PORT_OXM: {
|
||||
uint16_t port;
|
||||
if (ofputil_port_from_ofp11(value->be32, &port)) {
|
||||
port = OFPP_NONE;
|
||||
}
|
||||
ofputil_port_from_ofp11(value->be32, &port);
|
||||
flow->in_port = port;
|
||||
break;
|
||||
}
|
||||
@@ -2481,9 +2477,7 @@ mf_format(const struct mf_field *mf,
|
||||
case MFS_OFP_PORT_OXM:
|
||||
if (!mask) {
|
||||
uint16_t port;
|
||||
if (ofputil_port_from_ofp11(value->be32, &port)) {
|
||||
port = OFPP_NONE;
|
||||
}
|
||||
ofputil_port_from_ofp11(value->be32, &port);
|
||||
ofputil_format_port(port, s);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user