2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

meta-flow: Simplify mf_from_ofp_port_string()

ofputil_port_from_string() does all the work already.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jarno Rajahalme
2013-05-10 22:54:35 +03:00
committed by Ben Pfaff
parent bb79b46b34
commit 33ab38d9b8

View File

@@ -2168,17 +2168,13 @@ mf_from_ofp_port_string(const struct mf_field *mf, const char *s,
uint16_t port;
ovs_assert(mf->n_bytes == sizeof(ovs_be16));
if (*s == '-') {
return xasprintf("%s: negative values not supported for %s",
s, mf->name);
} else if (ofputil_port_from_string(s, &port)) {
if (ofputil_port_from_string(s, &port)) {
*valuep = htons(port);
*maskp = htons(UINT16_MAX);
return NULL;
} else {
return mf_from_integer_string(mf, s,
(uint8_t *) valuep, (uint8_t *) maskp);
}
return xasprintf("%s: port value out of range for %s", s, mf->name);
}
struct frag_handling {