Commit 32040ce4 authored by Oleg Zhurakivskyy's avatar Oleg Zhurakivskyy Committed by Jukka Rissanen
Browse files

net: tcp2: Intercept TCP



Intercept TCP.

Signed-off-by: default avatarOleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
parent 9c3fc831
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -23,6 +23,10 @@ LOG_MODULE_REGISTER(net_ipv4, CONFIG_NET_IPV4_LOG_LEVEL);
#include "udp_internal.h"
#include "tcp_internal.h"
#include "ipv4.h"
#ifdef CONFIG_NET_TCP2
#include "tcp2.h"
#endif
#include "tp.h"

/* Timeout for various buffer allocations in this file. */
#define NET_BUF_TIMEOUT K_MSEC(50)
@@ -118,6 +122,18 @@ enum net_verdict net_ipv4_input(struct net_pkt *pkt)
		goto drop;
	}

#if defined(CONFIG_NET_TCP2) && defined(CONFIG_NET_TEST_PROTOCOL)
	if (hdr->proto == IPPROTO_TCP) {
		tcp_input(pkt);
		goto drop;
	}
#endif
#if defined(CONFIG_NET_TEST_PROTOCOL)
	if (hdr->proto == IPPROTO_UDP) {
		tp_input(pkt);
		goto drop;
	}
#endif
	hdr_len = (hdr->vhl & NET_IPV4_IHL_MASK) * 4U;
	if (hdr_len < sizeof(struct net_ipv4_hdr)) {
		NET_DBG("DROP: Invalid hdr length");