uint16_t port;
assert(mf->n_bytes == sizeof(ovs_be16));
- if (ofputil_port_from_string(s, &port)) {
+ if (*s == '-') {
+ return xasprintf("%s: negative values not supported for %s",
+ s, mf->name);
+ } else if (ofputil_port_from_string(s, &port)) {
*valuep = htons(port);
*maskp = htons(UINT16_MAX);
return NULL;