Skip to content

Commit aa275e5

Browse files
Lukas Sismislukashino
Lukas Sismis
authored andcommitted
decode-udp: Allow shorter UDP packets than the remaining payload length
If the packet is shorter than IP payload length we no longer flag it as an invalid UDP packet. UDP packet can be therefore shorter than IP payload. Redmine ticket: OISF#5693
1 parent bf1c185 commit aa275e5

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/decode-udp.c

-5
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ static int DecodeUDPPacket(ThreadVars *t, Packet *p, const uint8_t *pkt, uint16_
5656
return -1;
5757
}
5858

59-
if (unlikely(len != UDP_GET_LEN(p))) {
60-
ENGINE_SET_INVALID_EVENT(p, UDP_HLEN_INVALID);
61-
return -1;
62-
}
63-
6459
SET_UDP_SRC_PORT(p,&p->sp);
6560
SET_UDP_DST_PORT(p,&p->dp);
6661

src/detect-engine-event.c

+3
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ static DetectEngineEventData *DetectEngineEventParse (const char *rawstr)
162162

163163
if (de->event == STREAM_REASSEMBLY_OVERLAP_DIFFERENT_DATA) {
164164
StreamTcpReassembleConfigEnableOverlapCheck();
165+
} else if (de->event == UDP_HLEN_INVALID) {
166+
SCLogWarning(SC_WARN_DEPRECATED, "Rule uses decode-event \"udp.hlen_invalid\" which will "
167+
"be deprecated in Suricata 8.0");
165168
}
166169
return de;
167170

0 commit comments

Comments
 (0)