ofproto-dpif: Make ofport_dpif_cast() internally consistent.
authorBen Pfaff <blp@nicira.com>
Wed, 8 May 2013 20:18:12 +0000 (13:18 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 9 May 2013 16:49:33 +0000 (09:49 -0700)
commite3d8644df32fc4664970ec5e02cffe9fe742f681
tree2fd874831b16c4dc624230e91160bf42d6320ab4
parent2db15dc5eb0ed2137fdb47a08a00c9f42da8d87e
ofproto-dpif: Make ofport_dpif_cast() internally consistent.

This function's assertion would dereference a null pointer given a null
'ofport' argument, but its return statement checked for a null pointer
argument.  This commit fixes the inconsistency in favor of supporting
null pointer arguments.  (I discovered this problem while writing a piece
of code that wanted support for a null pointer argument, otherwise I would
resolve the inconsistency in the other direction.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif.c