Project

General

Profile

Bug #823 ยป 0001-debug-display-invalid-packet.patch

Eric Leblond, 06/14/2013 10:15 AM

View differences:

src/source-af-packet.c
SCReturnInt(AFP_READ_OK);
}
#include "util-print.h"
TmEcode AFPWritePacket(Packet *p)
{
struct sockaddr_ll socket_address;
......
SCLogWarning(SC_ERR_SOCKET, "Sending packet failed on socket %d: %s",
socket,
strerror(errno));
if (PKT_IS_IPV4(p)) {
char srcip[16], dstip[16];
PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
SCLogInfo("%s:%" PRIu32 " -> %s:%" PRIu32 " [%d]", srcip, p->sp, dstip, p->dp, GET_PKT_LEN(p));
} else {
char srcip[46], dstip[46];
PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
SCLogInfo("%s:%" PRIu32 " -> %s:%" PRIu32 " [%d]", srcip, p->sp, dstip, p->dp, GET_PKT_LEN(p));
}
PrintRawDataFp(stdout,GET_PKT_DATA(p),GET_PKT_LEN(p));
if (p->afp_v.peer->flags & AFP_SOCK_PROTECT)
SCMutexUnlock(&p->afp_v.peer->sock_protect);
return TM_ECODE_FAILED;
    (1-1/1)