diff options
Diffstat (limited to 'lib/meta-flow.c')
-rw-r--r-- | lib/meta-flow.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/meta-flow.c b/lib/meta-flow.c index 3060c8bf..5e3007b3 100644 --- a/lib/meta-flow.c +++ b/lib/meta-flow.c @@ -1927,7 +1927,10 @@ mf_from_ofp_port_string(const struct mf_field *mf, const char *s, 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; |