tunnel: Correctly check for internal device.
authorJesse Gross <jesse@nicira.com>
Sat, 2 Oct 2010 02:21:08 +0000 (19:21 -0700)
committerJesse Gross <jesse@nicira.com>
Mon, 4 Oct 2010 23:31:31 +0000 (16:31 -0700)
commit4bee421f3ab28492aebc32b8b13e41ca5d12a936
treed8b2fd607ac0d4a35445b47707ecb1d433afa7a6
parenteedc0097f475a15297375a2aba39313c0f98f330
tunnel: Correctly check for internal device.

With header caching we check to see if the next device in the stack
is an OVS device and, if so, cache that flow as well.  However, the
test for this called internal_dev_get_vport() assuming that it would
return NULL if the device is not an internal device.  It doesn't,
however, it just returns the offset from the device where the vport
data structure would be if it were an internal device.  This changes
it to explicitly check for an internal device first to avoid a panic.

Bug #3470

Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Reviewed-by: Justin Pettit <jpettit@nicira.com>
datapath/tunnel.c