Skip to content

Commit

Permalink
flow: cleanup and clarify ancient debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Nov 27, 2022
1 parent 64adb30 commit 002cd8e
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/flow-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

#include "decode-icmpv4.h"

#include "util-validate.h"

/** \brief allocate a flow
*
* We check against the memuse counter. If it passes that check we increment
Expand Down Expand Up @@ -162,13 +164,10 @@ void FlowInit(Flow *f, const Packet *p)
FLOW_SET_IPV6_DST_ADDR_FROM_PACKET(p, &f->dst);
f->min_ttl_toserver = f->max_ttl_toserver = IPV6_GET_HLIM((p));
f->flags |= FLOW_IPV6;
} else {
SCLogDebug("neither IPv4 or IPv6, weird");
DEBUG_VALIDATE_BUG_ON(1);
}
#ifdef DEBUG
/* XXX handle default */
else {
printf("FIXME: %s:%s:%" PRId32 "\n", __FILE__, __FUNCTION__, __LINE__);
}
#endif

if (p->tcph != NULL) { /* XXX MACRO */
SET_TCP_SRC_PORT(p,&f->sp);
Expand All @@ -187,12 +186,10 @@ void FlowInit(Flow *f, const Packet *p)
} else if (p->sctph != NULL) { /* XXX MACRO */
SET_SCTP_SRC_PORT(p,&f->sp);
SET_SCTP_DST_PORT(p,&f->dp);
} /* XXX handle default */
#ifdef DEBUG
else {
printf("FIXME: %s:%s:%" PRId32 "\n", __FILE__, __FUNCTION__, __LINE__);
} else {
/* nothing to do for this IP proto. */
SCLogDebug("no special setup for IP proto %u", p->proto);
}
#endif
COPY_TIMESTAMP(&p->ts, &f->startts);

f->protomap = FlowGetProtoMapping(f->proto);
Expand Down

0 comments on commit 002cd8e

Please sign in to comment.