aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-11-16 09:57:50 -0800
committerFlorin Coras <fcoras@cisco.com>2017-11-16 10:09:34 -0800
commit403642734cbc8fce203e0e4130904ecf2eb2cc8e (patch)
tree24d94d74ba10b2b36e104c363d1aaeaf674bbdf2 /src/vnet
parent52925385345e2222151b6e8c28e3d914ff0b407f (diff)
tcp: register with ip for header parsing by default
Change-Id: I4e420bcc9241b03e179a939911059c0cc3704a51 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/tcp/tcp.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 1c44ef04f85..a0a5f190fa4 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1151,8 +1151,6 @@ clib_error_t *
tcp_main_enable (vlib_main_t * vm)
{
tcp_main_t *tm = vnet_get_tcp_main ();
- ip_protocol_info_t *pi;
- ip_main_t *im = &ip_main;
vlib_thread_main_t *vtm = vlib_get_thread_main ();
clib_error_t *error = 0;
u32 num_threads;
@@ -1171,13 +1169,6 @@ tcp_main_enable (vlib_main_t * vm)
* Registrations
*/
- /* Register with IP */
- pi = ip_get_protocol_info (im, IP_PROTOCOL_TCP);
- if (pi == 0)
- return clib_error_return (0, "TCP protocol info AWOL");
- pi->format_header = format_tcp_header;
- 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);
@@ -1282,7 +1273,19 @@ clib_error_t *
tcp_init (vlib_main_t * vm)
{
tcp_main_t *tm = vnet_get_tcp_main ();
+ ip_main_t *im = &ip_main;
+ ip_protocol_info_t *pi;
+
+ /* Session layer, and by implication tcp, are disabled by default */
tm->is_enabled = 0;
+
+ /* Register with IP for header parsing */
+ pi = ip_get_protocol_info (im, IP_PROTOCOL_TCP);
+ if (pi == 0)
+ return clib_error_return (0, "TCP protocol info AWOL");
+ pi->format_header = format_tcp_header;
+ pi->unformat_pg_edit = unformat_pg_tcp_header;
+
tcp_api_reference ();
return 0;
}