fix incorrect offset in decode-ethernet for PPPoE, more debug statements

remotes/origin/master-1.0.x
Jamie 16 years ago committed by Victor Julien
parent 4ec31e0445
commit 698e9c0699

@ -30,7 +30,7 @@ void DecodeEthernet(ThreadVars *t, Packet *p, uint8_t *pkt, uint16_t len, Packet
} else if(ntohs(ethh->eth_type) == ETHERNET_TYPE_PPPoE_SESS) { } else if(ntohs(ethh->eth_type) == ETHERNET_TYPE_PPPoE_SESS) {
//printf("DecodeEthernet PPPoE\n"); //printf("DecodeEthernet PPPoE\n");
PerfCounterIncr(COUNTER_DECODER_PPPOE, t->pca); PerfCounterIncr(COUNTER_DECODER_PPPOE, t->pca);
DecodePPPoE(t, p, pkt + PPPOE_HEADER_LEN, len - PPPOE_HEADER_LEN, pq); DecodePPPoE(t, p, pkt + ETHERNET_HEADER_LEN, len - ETHERNET_HEADER_LEN, pq);
} }
return; return;

@ -5,6 +5,9 @@
#include "decode-icmpv4.h" #include "decode-icmpv4.h"
#include "util-unittest.h" #include "util-unittest.h"
/** DecodeICMPV4
* \brief Main ICMPv4 decoding function
*/
void DecodeICMPV4(ThreadVars *t, Packet *p, uint8_t *pkt, uint16_t len) void DecodeICMPV4(ThreadVars *t, Packet *p, uint8_t *pkt, uint16_t len)
{ {
p->icmpv4h = (ICMPV4Hdr *)pkt; p->icmpv4h = (ICMPV4Hdr *)pkt;

@ -32,7 +32,12 @@ void DecodePPPoE(ThreadVars *t, Packet *p, uint8_t *pkt, uint16_t len, PacketQue
if (p->pppoeh == NULL) if (p->pppoeh == NULL)
return; return;
if (p->pppoeh->pppoe_length > 0) { #ifdef DEBUG
printf("PPPOE VERSION %" PRIu32 " TYPE %" PRIu32 " CODE %" PRIu32 " SESSIONID %" PRIu32 " LENGTH %" PRIu32 "\n",
p->pppoeh->pppoe_version, p->pppoeh->pppoe_type, p->pppoeh->pppoe_code, ntohs(p->pppoeh->session_id), ntohs(p->pppoeh->pppoe_length));
#endif
if (ntohs(p->pppoeh->pppoe_length) > 0) {
/* decode contained PPP packet */ /* decode contained PPP packet */
PerfCounterIncr(COUNTER_DECODER_PPP, t->pca); PerfCounterIncr(COUNTER_DECODER_PPP, t->pca);
DecodePPP(t, p, pkt + PPPOE_HEADER_LEN, len - PPPOE_HEADER_LEN, pq); DecodePPP(t, p, pkt + PPPOE_HEADER_LEN, len - PPPOE_HEADER_LEN, pq);

@ -24,7 +24,7 @@ typedef struct _PPPoEHdr
unsigned pppoe_version : 4; unsigned pppoe_version : 4;
unsigned pppoe_type : 4; unsigned pppoe_type : 4;
uint8_t pppoe_code; uint8_t pppoe_code;
uint16_t sessin_id; uint16_t session_id;
uint16_t pppoe_length; uint16_t pppoe_length;
} PPPoEHdr; } PPPoEHdr;

Loading…
Cancel
Save