aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authortjanciga <tomas.janciga@pantheon.tech>2017-08-24 11:57:21 +0200
committerDave Barach <openvpp@barachs.net>2017-08-25 12:48:29 +0000
commitffef404ad8b21cbeb09c1f70e9decfe1146d8727 (patch)
tree5f91102ace86e2eb436e7b351ab1d1f1d84f85ce /src/vnet/tcp/tcp.c
parent81d1e27eed522e0fa4c4f670042bdc8159f0fc9b (diff)
Fix crash when TCP client using VPP host stack connects first
VPP is crashing without this fix if there is not any server using VPP host stack and client attemts to connect. Change-Id: I672977f78180bbc5ba9259116b2e165363463ccd Signed-off-by: tjanciga <tomas.janciga@pantheon.tech>
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 1d10f9bb..6edf52af 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -595,6 +595,12 @@ tcp_connection_open (transport_endpoint_t * rmt)
prefix.fp_len = rmt->is_ip4 ? 32 : 128;
fib_index = fib_table_find (prefix.fp_proto, rmt->vrf);
+ if (fib_index == (u32) ~ 0)
+ {
+ clib_warning ("no fib table");
+ return -1;
+ }
+
fei = fib_table_lookup (fib_index, &prefix);
/* Couldn't find route to destination. Bail out. */