dpif-linux: Fix segfault when a port already exists.
authorJustin Pettit <jpettit@nicira.com>
Wed, 16 Jan 2013 23:53:14 +0000 (15:53 -0800)
committerJustin Pettit <jpettit@nicira.com>
Thu, 17 Jan 2013 01:35:51 +0000 (17:35 -0800)
commit2510ba7cfde15fdacea42e920c61d7be131ba0cd
treea06668b9cbed383f03240f6e051ac9998fdd3fc2
parent4958e3ee121f31909696e0d98930805f45ba9188
dpif-linux: Fix segfault when a port already exists.

Commit 78a2d59c (dpif-linux.c: Let the kernel pick a port number if one
not requested.) changed the logic for port assignment, but didn't
properly handle some error conditions.  An attempt to add a tunnel port
that already exists would lead to a segfault.  This commit fixes the
logic to stop processing and return an error.

Reported-by: Gurucharan Shetty <shettyg@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
lib/dpif-linux.c