SCReturn;
case IPPROTO_ROUTING:
+ IPV6_SET_L4PROTO(p,nh);
hdrextlen = 8 + (*(pkt+1) * 8); /* 8 bytes + length in 8 octet units */
SCLogDebug("hdrextlen %"PRIu8, hdrextlen);
IPV6OptJumbo *jumbo = NULL;
uint8_t optslen = 0;
+ IPV6_SET_L4PROTO(p,nh);
hdrextlen = (*(pkt+1) + 1) << 3;
if (hdrextlen > plen) {
ENGINE_SET_EVENT(p, IPV6_TRUNC_EXTHDR);
}
case IPPROTO_FRAGMENT:
+ IPV6_SET_L4PROTO(p,nh);
/* store the offset of this extension into the packet
* past the ipv6 header. We use it in defrag for creating
* a defragmented packet without the frag header */
case IPPROTO_ESP:
{
+ IPV6_SET_L4PROTO(p,nh);
hdrextlen = sizeof(IPV6EspHdr);
if (hdrextlen > plen) {
ENGINE_SET_EVENT(p, IPV6_TRUNC_EXTHDR);
}
case IPPROTO_AH:
{
+ IPV6_SET_L4PROTO(p,nh);
/* we need the header as a minimum */
hdrextlen = sizeof(IPV6AuthHdr);
/* the payload len field is the number of extra 4 byte fields */
f = 1;
SCLogDebug("f %d", f);
+ SCLogDebug("IP_GET_IPPROTO(p) %u", IP_GET_IPPROTO(p));
/* find the right mpm instance */
DetectAddress *ag = DetectAddressLookupInHead(de_ctx->flow_gh[f].src_gh[IP_GET_IPPROTO(p)], &p->src);
return result;
}
-int SigTest27NegativeTCPV4Keyword(void)
+static int SigTest27NegativeTCPV4Keyword(void)
{
uint8_t raw_ipv4[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
de_ctx->flags |= DE_QUIET;
de_ctx->sig_list = SigInit(de_ctx,
- "alert tcp any any -> any any "
- "(content:\"|DE 01 03|\"; tcpv4-csum:invalid; dsize:20; "
- "msg:\"tcpv4-csum keyword check(1)\"; sid:1;)");
+ "alert tcp any any -> any any "
+ "(content:\"|DE 01 03|\"; tcpv4-csum:invalid; dsize:20; "
+ "msg:\"tcpv4-csum keyword check(1)\"; sid:1;)");
if (de_ctx->sig_list == NULL) {
goto end;
}
de_ctx->sig_list->next = SigInit(de_ctx,
"alert tcp any any -> any any "
"(content:\"|DE 01 03|\"; tcpv4-csum:valid; dsize:20; "
- "msg:\"tcpv4-csum keyword check(1)\"; "
+ "msg:\"tcpv4-csum keyword check(2)\"; "
"sid:2;)");
if (de_ctx->sig_list->next == NULL) {
goto end;
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx,(void *)&det_ctx);
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if (PacketAlertCheck(p1, 1)) {
+ if (!PacketAlertCheck(p1, 1)) {
+ printf("sig 1 didn't match on p1: ");
goto end;
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
if (PacketAlertCheck(p2, 2)) {
+ printf("sig 2 matched on p2: ");
goto end;
}
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx,(void *)&det_ctx);
SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
- if (!(PacketAlertCheck(p1, 1)))
+ if (!(PacketAlertCheck(p1, 1))) {
+ printf("sid 1 didn't match on p1: ");
goto end;
+ }
SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
- if (!(PacketAlertCheck(p2, 2)))
+ if (!(PacketAlertCheck(p2, 2))) {
+ printf("sid 2 didn't match on p2: ");
goto end;
+ }
result = 1;
end: