decode/ppp: remove ppph check in favor of flag

As we now support variable size headers, we can't use the old pointer.

Replace with a flag.

(cherry picked from commit 6067955afd)
pull/11135/head
Victor Julien 2 years ago committed by Victor Julien
parent 701468d3de
commit 4f0709e0ee

@ -601,7 +601,7 @@ int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
}
case IPPROTO_IP:
/* check PPP VJ uncompressed packets and decode tcp dummy */
if(p->ppph != NULL && SCNtohs(p->ppph->protocol) == PPP_VJ_UCOMP) {
if (p->flags & PKT_PPP_VJ_UCOMP) {
DecodeTCP(tv, dtv, p, pkt + IPV4_GET_HLEN(p),
IPV4_GET_IPLEN(p) - IPV4_GET_HLEN(p));
}

@ -75,6 +75,7 @@ static int DecodePPPCompressedProto(ThreadVars *tv, DecodeThreadVars *dtv, Packe
}
if (likely(IPV4_GET_RAW_VER((IPV4Hdr *)(pkt + data_offset)) == 4)) {
p->flags |= PKT_PPP_VJ_UCOMP;
return DecodeIPV4(tv, dtv, p, pkt + data_offset, (uint16_t)(len - data_offset));
} else
return TM_ECODE_FAILED;

@ -984,7 +984,8 @@ void DecodeUnregisterCounters(void);
/** Flag to indicate that packet header or contents should not be inspected */
#define PKT_NOPACKET_INSPECTION BIT_U32(0)
// vacancy
/** Packet has a PPP_VJ_UCOMP header */
#define PKT_PPP_VJ_UCOMP BIT_U32(1)
/** Flag to indicate that packet contents should not be inspected */
#define PKT_NOPAYLOAD_INSPECTION BIT_U32(2)

Loading…
Cancel
Save