Set the ethernet header pointer. Without this, alert-unified-log will add an extra ethernet header to every alert logged.

remotes/origin/master-1.0.x
Jason Ish 16 years ago committed by Victor Julien
parent 565eab1f54
commit cc28284598

@ -17,13 +17,13 @@ void DecodeEthernet(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *p
return; return;
} }
EthernetHdr *ethh = (EthernetHdr *)pkt; p->ethh = (EthernetHdr *)pkt;
if (ethh == NULL) if (p->ethh == NULL)
return; return;
SCLogDebug("p %p pkt %p ether type %04x", p, pkt, ntohs(ethh->eth_type)); SCLogDebug("p %p pkt %p ether type %04x", p, pkt, ntohs(p->ethh->eth_type));
switch (ntohs(ethh->eth_type)) { switch (ntohs(p->ethh->eth_type)) {
case ETHERNET_TYPE_IP: case ETHERNET_TYPE_IP:
//printf("DecodeEthernet ip4\n"); //printf("DecodeEthernet ip4\n");
DecodeIPV4(tv, dtv, p, pkt + ETHERNET_HEADER_LEN, DecodeIPV4(tv, dtv, p, pkt + ETHERNET_HEADER_LEN,
@ -46,7 +46,7 @@ void DecodeEthernet(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *p
break; break;
default: default:
SCLogDebug("p %p pkt %p ether type %04x not supported", p, SCLogDebug("p %p pkt %p ether type %04x not supported", p,
pkt, ntohs(ethh->eth_type)); pkt, ntohs(p->ethh->eth_type));
} }
return; return;

Loading…
Cancel
Save