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 8b60b35f1..de11bdf7b 100644 --- a/lib/meta-flow.c +++ b/lib/meta-flow.c @@ -2082,7 +2082,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; |