summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorroot <root@wasa-ucs-13.linuxfoundation.org>2017-08-15 12:58:31 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-08-16 16:47:44 +0000
commitc9d1c5b6b3668e243bbdd978069976cc1184892b (patch)
tree58442fb9d3f12f1562c0f24c4aaa4eccac666f67 /src/vnet/tcp/tcp.c
parentab9a59c19a2765e001dd24a8f3e51882b6806e2d (diff)
tcp: fix v6 sessions
Change-Id: Ia6dd5e948b17b2f3866fe70838eabb09e35415e1 Signed-off-by: Dave Barach <dbarach@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 75c9d8dcc3d..d16900229ff 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -362,7 +362,11 @@ ip_interface_get_first_ip (u32 sw_if_index, u8 is_ip4)
/* *INDENT-OFF* */
foreach_ip_interface_address (lm6, ia, sw_if_index, 1 /* unnumbered */ ,
({
- return ip_interface_address_get_address (lm6, ia);
+ ip6_address_t *rv;
+ rv = ip_interface_address_get_address (lm6, ia);
+ /* Trying to use a link-local ip6 src address is a fool's errand */
+ if (!ip6_address_is_link_local_unicast (rv))
+ return rv;
}));
/* *INDENT-ON* */
}
@@ -635,6 +639,14 @@ tcp_connection_open (transport_endpoint_t * rmt)
else
{
ip6 = ip_interface_get_first_ip (sw_if_index, 0);
+ if (ip6 == 0)
+ {
+ clib_warning ("no routable ip6 addresses on %U",
+ format_vnet_sw_if_index_name, vnet_get_main (),
+ sw_if_index);
+ return -1;
+ }
+
clib_memcpy (&lcl_addr.ip6, ip6, sizeof (*ip6));
}
}
@@ -1109,7 +1121,6 @@ tcp_timer_establish_handler (u32 conn_index)
if (tc)
{
ASSERT (tc->state == TCP_STATE_SYN_SENT);
- tc->timers[TCP_TIMER_ESTABLISH] = TCP_TIMER_HANDLE_INVALID;
stream_session_connect_notify (&tc->connection, 1 /* fail */ );
}
else
@@ -1117,6 +1128,7 @@ tcp_timer_establish_handler (u32 conn_index)
tc = tcp_connection_get (conn_index, vlib_get_thread_index ());
ASSERT (tc->state == TCP_STATE_SYN_RCVD);
}
+ tc->timers[TCP_TIMER_ESTABLISH] = TCP_TIMER_HANDLE_INVALID;
tcp_connection_cleanup (tc);
}
@@ -1231,6 +1243,7 @@ tcp_main_enable (vlib_main_t * vm)
pi->unformat_pg_edit = unformat_pg_tcp_header;
ip4_register_protocol (IP_PROTOCOL_TCP, tcp4_input_node.index);
+ ip6_register_protocol (IP_PROTOCOL_TCP, tcp6_input_node.index);
/* Register as transport with session layer */
session_register_transport (TRANSPORT_PROTO_TCP, 1, &tcp_proto);