af-packet: simplify tpacket-v2 setup code

Setup can no longer fail, so make the function void and remove dead
error checking code.
pull/6600/head
Victor Julien 4 years ago
parent 2cbfcce0ac
commit ace349d4d9

@ -923,7 +923,7 @@ static inline void AFPReadApplyBypass(const AFPThreadVars *ptv, Packet *p)
/** \internal
* \brief setup packet for AFPReadFromRing
*/
static bool AFPReadFromRingSetupPacket(
static void AFPReadFromRingSetupPacket(
AFPThreadVars *ptv, union thdr h, const unsigned int tp_status, Packet *p)
{
PKT_SET_SRC(p, PKT_SRC_WIRE);
@ -982,7 +982,6 @@ static bool AFPReadFromRingSetupPacket(
p->flags |= PKT_IGNORE_CHECKSUM;
}
}
return true;
}
static inline int AFPReadFromRingWaitForPacket(AFPThreadVars *ptv)
@ -1072,10 +1071,7 @@ static int AFPReadFromRing(AFPThreadVars *ptv)
if (p == NULL) {
return AFPSuriFailure(ptv, h);
}
if (AFPReadFromRingSetupPacket(ptv, h, tp_status, p) == false) {
TmqhOutputPacketpool(ptv->tv, p);
return AFPSuriFailure(ptv, h);
}
AFPReadFromRingSetupPacket(ptv, h, tp_status, p);
if (TmThreadsSlotProcessPkt(ptv->tv, ptv->slot, p) != TM_ECODE_OK) {
return AFPSuriFailure(ptv, h);

Loading…
Cancel
Save