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:27:54 +0000 (16:27 -0800)
commit05dddbac2fd8652409a1a377fcebfd46c35673be
tree3ad036b0da0c2d24f9db694a3ec54e39996ee46f
parentd047fd17b88dab301d01a67ac6531865767aeeca
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