summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bb79b46)
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>
uint16_t port;
ovs_assert(mf->n_bytes == sizeof(ovs_be16));
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;
*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);