decode/pppoe: localize pppoesh header pointer

Remove header pointer from Packet as there were no users of it.

Ticket: #6938.
pull/10971/head
Victor Julien 2 years ago committed by Victor Julien
parent 852ff83d70
commit b4ef910aff

@ -134,17 +134,19 @@ int DecodePPPOESession(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
return TM_ECODE_FAILED;
}
p->pppoesh = (PPPOESessionHdr *)pkt;
PPPOESessionHdr *pppoesh = (PPPOESessionHdr *)pkt;
SCLogDebug("PPPOE VERSION %" PRIu32 " TYPE %" PRIu32 " CODE %" PRIu32 " SESSIONID %" PRIu32 " LENGTH %" PRIu32 "",
PPPOE_SESSION_GET_VERSION(p->pppoesh), PPPOE_SESSION_GET_TYPE(p->pppoesh), p->pppoesh->pppoe_code, SCNtohs(p->pppoesh->session_id), SCNtohs(p->pppoesh->pppoe_length));
SCLogDebug("PPPOE VERSION %" PRIu32 " TYPE %" PRIu32 " CODE %" PRIu32 " SESSIONID %" PRIu32
" LENGTH %" PRIu32 "",
PPPOE_SESSION_GET_VERSION(pppoesh), PPPOE_SESSION_GET_TYPE(pppoesh),
pppoesh->pppoe_code, SCNtohs(pppoesh->session_id), SCNtohs(pppoesh->pppoe_length));
/* can't use DecodePPP() here because we only get a single 2-byte word to indicate protocol instead of the full PPP header */
if (SCNtohs(p->pppoesh->pppoe_length) > 0) {
if (SCNtohs(pppoesh->pppoe_length) > 0) {
/* decode contained PPP packet */
uint8_t pppoesh_len;
uint16_t ppp_protocol = SCNtohs(p->pppoesh->protocol);
uint16_t ppp_protocol = SCNtohs(pppoesh->protocol);
/* According to RFC1661-2, if the least significant bit of the most significant octet is
* set, we're dealing with a single-octet protocol field */

@ -583,7 +583,6 @@ typedef struct Packet_
TCPHdr *tcph;
UDPHdr *udph;
PPPOESessionHdr *pppoesh;
PPPOEDiscoveryHdr *pppoedh;
/* ptr to the payload of the packet

@ -121,7 +121,6 @@ void PacketReinit(Packet *p)
if (p->udph != NULL) {
CLEAR_UDP_PACKET(p);
}
p->pppoesh = NULL;
p->pppoedh = NULL;
p->payload = NULL;
p->payload_len = 0;

Loading…
Cancel
Save