meta-flow: Don't allow negative port numbers.
authorJustin Pettit <jpettit@nicira.com>
Fri, 14 Dec 2012 00:22:55 +0000 (16:22 -0800)
committerJustin Pettit <jpettit@nicira.com>
Fri, 14 Dec 2012 00:32:51 +0000 (16:32 -0800)
commit8742e5741e935ebf99cca0e1a1e772e9c8fae206
tree01cad84c044372f66abacf7c1ed1eecdac00a387
parent3ecabd2412db364277b13e6abcbdc037c51e5796
meta-flow: Don't allow negative port numbers.

If a negative number is supplied, the parsing code used to convert it
into a signed one.  We ran into an incident where a third-party script
was attempting to get the OpenFlow port number for an interface, but got
-1 from the database, since the number had not yet been assigned.  This
was converted to 65535, which maps to OFPP_NONE and all flows with
ingress port OFPP_NONE were modified.  This commit disallows negative
port numbers to help prevent broken integration scripts from disturbing
the flow table.

Issue #14036

Signed-off-by: Justin Pettit <jpettit@nicira.com>
lib/meta-flow.c