decode/ppp: clean up ppph pointer use

No users of the pointer anymore, so remove it.
pull/10852/head
Victor Julien 2 years ago committed by Victor Julien
parent 6067955afd
commit 7e3f071e49

@ -215,17 +215,10 @@ int DecodePPP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *p
}
/* implied proto_offset + proto_size == 4, so continue below */
p->ppph = (PPPHdr *)pkt;
SCLogDebug("p %p pkt %p PPP protocol %04x Len: %" PRIu32 "", p, pkt, SCNtohs(p->ppph->protocol),
len);
int r = DecodePPPUncompressedProto(
tv, dtv, p, pkt, len, SCNtohs(p->ppph->protocol), data_offset);
if (r < 0) {
p->ppph = NULL;
}
return r;
const PPPHdr *ppph = (PPPHdr *)pkt;
SCLogDebug(
"p %p pkt %p PPP protocol %04x Len: %" PRIu32 "", p, pkt, SCNtohs(ppph->protocol), len);
return DecodePPPUncompressedProto(tv, dtv, p, pkt, len, SCNtohs(ppph->protocol), data_offset);
}
/* TESTS BELOW */
@ -321,11 +314,6 @@ static int DecodePPPtest03 (void)
FlowShutdown();
if(p->ppph == NULL) {
SCFree(p);
return 0;
}
if(ENGINE_ISSET_EVENT(p,PPP_PKT_TOO_SMALL)) {
SCFree(p);
return 0;
@ -379,11 +367,6 @@ static int DecodePPPtest04 (void)
FlowShutdown();
if(p->ppph == NULL) {
SCFree(p);
return 0;
}
if (!(ENGINE_ISSET_EVENT(p,IPV4_TRUNC_PKT))) {
SCFree(p);
return 0;

@ -576,7 +576,6 @@ typedef struct Packet_
ICMPV6Hdr *icmpv6h;
PPPHdr *ppph;
PPPOESessionHdr *pppoesh;
PPPOEDiscoveryHdr *pppoedh;

@ -138,7 +138,6 @@ void PacketReinit(Packet *p)
if (p->icmpv6h != NULL) {
CLEAR_ICMPV6_PACKET(p);
}
p->ppph = NULL;
p->pppoesh = NULL;
p->pppoedh = NULL;
p->greh = NULL;

Loading…
Cancel
Save