p->ip4h = NULL;
return;
}
+ p->proto = IPV4_GET_IPPROTO(p);
/* If a fragment, pass off for re-assembly. */
if (unlikely(IPV4_GET_IPOFFSET(p) > 0 || IPV4_GET_MF(p) == 1)) {
DecodeIPV4(tv, dtv, rp, (void *)rp->ip4h, IPV4_GET_IPLEN(rp), pq);
PacketEnqueue(pq, rp);
}
+ p->flags |= PKT_IS_FRAGMENT;
return;
}
IPV4_GET_IPLEN(p) - IPV4_GET_HLEN(p), pq);
}
break;
- default:
- p->proto = IPV4_GET_IPPROTO(p);
- break;
}
return;
}
/* the rest is parsed upon reassembly */
+ p->flags |= PKT_IS_FRAGMENT;
SCReturn;
case IPPROTO_ESP:
ENGINE_SET_EVENT(p,IPV6_WITH_ICMPV4);
break;
default:
- p->proto = IPV6_GET_NH(p);
+ IPV6_SET_L4PROTO (p, IPV6_GET_NH(p));
break;
}
+ p->proto = IPV6_GET_L4PROTO (p);
/* Pass to defragger if a fragment. */
if (IPV6_EXTHDR_ISSET_FH(p)) {
#define PKT_HOST_SRC_LOOKED_UP (1<<17)
#define PKT_HOST_DST_LOOKED_UP (1<<18)
+#define PKT_IS_FRAGMENT (1<<19) /**< Packet is a fragment */
+
/** \brief return 1 if the packet is a pseudo packet */
#define PKT_IS_PSEUDOPKT(p) ((p)->flags & PKT_PSEUDO_STREAM_END)
/* check the source & dst port in the sig */
if (p->proto == IPPROTO_TCP || p->proto == IPPROTO_UDP || p->proto == IPPROTO_SCTP) {
if (!(s->flags & SIG_FLAG_DP_ANY)) {
+ if (p->flags & PKT_IS_FRAGMENT)
+ continue;
+
DetectPort *dport = DetectPortLookupGroup(s->dp,p->dp);
if (dport == NULL) {
SCLogDebug("dport didn't match.");
}
}
if (!(s->flags & SIG_FLAG_SP_ANY)) {
+ if (p->flags & PKT_IS_FRAGMENT)
+ continue;
+
DetectPort *sport = DetectPortLookupGroup(s->sp,p->sp);
if (sport == NULL) {
SCLogDebug("sport didn't match.");
/* check the source & dst port in the sig */
if (p->proto == IPPROTO_TCP || p->proto == IPPROTO_UDP || p->proto == IPPROTO_SCTP) {
if (!(s->flags & SIG_FLAG_DP_ANY)) {
+ if (p->flags & PKT_IS_FRAGMENT)
+ goto next;
DetectPort *dport = DetectPortLookupGroup(s->dp,p->dp);
if (dport == NULL) {
SCLogDebug("dport didn't match.");
}
}
if (!(s->flags & SIG_FLAG_SP_ANY)) {
+ if (p->flags & PKT_IS_FRAGMENT)
+ goto next;
DetectPort *sport = DetectPortLookupGroup(s->sp,p->sp);
if (sport == NULL) {
SCLogDebug("sport didn't match.");