From 4c1554f4f690a7e89c4190b0fa3f31a19d0bbedc Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 5 Dec 2024 10:00:14 +0100 Subject: [PATCH] stream: remove unused function argument Sequence number is taken from seg, not the func arg. --- src/stream-tcp-list.c | 2 +- src/stream-tcp-reassemble.c | 2 +- src/stream-tcp-reassemble.h | 3 ++- src/stream-tcp-util.c | 6 ++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/stream-tcp-list.c b/src/stream-tcp-list.c index 0e6499337a..2b477affd5 100644 --- a/src/stream-tcp-list.c +++ b/src/stream-tcp-list.c @@ -633,7 +633,7 @@ static void StreamTcpSegmentAddPacketData( */ int StreamTcpReassembleInsertSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpStream *stream, TcpSegment *seg, Packet *p, - uint32_t pkt_seq, uint8_t *pkt_data, uint16_t pkt_datalen) + uint8_t *pkt_data, uint16_t pkt_datalen) { SCEnter(); diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 11baf692ec..3f5b2892ed 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -805,7 +805,7 @@ int StreamTcpReassembleHandleSegmentHandleData(ThreadVars *tv, TcpReassemblyThre } int r = StreamTcpReassembleInsertSegment( - tv, ra_ctx, stream, seg, p, TCP_GET_RAW_SEQ(tcph), p->payload, p->payload_len); + tv, ra_ctx, stream, seg, p, p->payload, p->payload_len); if (r < 0) { if (r == -SC_ENOMEM) { ssn->flags |= STREAMTCP_FLAG_LOSSY_BE_LIBERAL; diff --git a/src/stream-tcp-reassemble.h b/src/stream-tcp-reassemble.h index d2482bf5ea..f5d30d9859 100644 --- a/src/stream-tcp-reassemble.h +++ b/src/stream-tcp-reassemble.h @@ -110,7 +110,8 @@ void StreamTcpSetOSPolicy(TcpStream *, Packet *); int StreamTcpReassembleHandleSegmentHandleData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p); -int StreamTcpReassembleInsertSegment(ThreadVars *, TcpReassemblyThreadCtx *, TcpStream *, TcpSegment *, Packet *, uint32_t pkt_seq, uint8_t *pkt_data, uint16_t pkt_datalen); +int StreamTcpReassembleInsertSegment(ThreadVars *, TcpReassemblyThreadCtx *, TcpStream *, + TcpSegment *, Packet *, uint8_t *pkt_data, uint16_t pkt_datalen); TcpSegment *StreamTcpGetSegment(ThreadVars *, TcpReassemblyThreadCtx *); void StreamTcpReturnStreamSegments(TcpStream *); diff --git a/src/stream-tcp-util.c b/src/stream-tcp-util.c index ea63578544..319b47f329 100644 --- a/src/stream-tcp-util.c +++ b/src/stream-tcp-util.c @@ -126,8 +126,7 @@ int StreamTcpUTAddSegmentWithPayload(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ } p->l4.hdrs.tcph->th_seq = htonl(seq); - if (StreamTcpReassembleInsertSegment(tv, ra_ctx, stream, s, p, TCP_GET_RAW_SEQ(p->l4.hdrs.tcph), - p->payload, p->payload_len) < 0) + if (StreamTcpReassembleInsertSegment(tv, ra_ctx, stream, s, p, p->payload, p->payload_len) < 0) return -1; UTHFreePacket(p); @@ -152,8 +151,7 @@ int StreamTcpUTAddSegmentWithByte(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx } p->l4.hdrs.tcph->th_seq = htonl(seq); - if (StreamTcpReassembleInsertSegment(tv, ra_ctx, stream, s, p, TCP_GET_RAW_SEQ(p->l4.hdrs.tcph), - p->payload, p->payload_len) < 0) + if (StreamTcpReassembleInsertSegment(tv, ra_ctx, stream, s, p, p->payload, p->payload_len) < 0) return -1; UTHFreePacket(p); return 0;