Add Packet/IPv4/TCP/UDP helpers API
This commit is contained in:
@@ -386,7 +386,13 @@ static void update_udp_ex_data(struct session *sess, const struct packet *pkt, e
|
||||
// return -1: tcp not syn packet, discard
|
||||
static int handle_tcp_new_session(struct session_manager *mgr, struct tuple6 *key, struct session *sess, const struct packet *pkt)
|
||||
{
|
||||
const struct tcphdr *hdr = (const struct tcphdr *)packet_get_tcp_hdr_ptr(pkt);
|
||||
const struct layer_record *tcp_layer = packet_get_innermost_layer(pkt, LAYER_TYPE_TCP);
|
||||
if (tcp_layer == NULL)
|
||||
{
|
||||
// not tcp packet, discard
|
||||
return -1;
|
||||
}
|
||||
const struct tcphdr *hdr = (const struct tcphdr *)tcp_layer->hdr_ptr;
|
||||
if (!tcp_hdr_has_flag_syn(hdr))
|
||||
{
|
||||
// not syn packet, discard
|
||||
|
||||
Reference in New Issue
Block a user