datapath: Use RCU dereference in vport_get_ifindex().
authorJesse Gross <jesse@nicira.com>
Fri, 24 Dec 2010 00:47:45 +0000 (16:47 -0800)
committerJesse Gross <jesse@nicira.com>
Wed, 29 Dec 2010 18:42:10 +0000 (10:42 -0800)
commit6b02c20141e318bf95ecbd384c73bdf7f74920d3
tree6347dfd2c70b1344b30b7c0218cddf62a80c2870
parent39872c70e2feefb85e3d7aa577d281d20c8decf6
datapath: Use RCU dereference in vport_get_ifindex().

If we don't have an ifindex for a device (because it is a virtual
port), we fall back to using the ifindex of the local port.
However, we weren't properly dereferencing the vport from the ports
array, so this adds that.  This isn't a real problem though, because
the local port always exists and never changes as long as the
datapath exists.

Found with sparse.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/vport.c