diff --git a/src/app-layer-htp-xff.c b/src/app-layer-htp-xff.c index 96e2ab8f40..1c5ef557c0 100644 --- a/src/app-layer-htp-xff.c +++ b/src/app-layer-htp-xff.c @@ -177,7 +177,7 @@ int HttpXFFGetIPFromTx(const Flow *f, uint64_t tx_id, HttpXFFCfg *xff_cfg, int HttpXFFGetIP(const Flow *f, HttpXFFCfg *xff_cfg, char *dstbuf, int dstbuflen) { HtpState *htp_state = NULL; - uint64_t tx_id = 0; + uint64_t tx_id = AppLayerParserGetMinId(f->alparser); uint64_t total_txs = 0; htp_state = (HtpState *)FlowGetAppState(f); diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index a1aa767aa1..68102c2ad1 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -705,6 +705,13 @@ uint64_t AppLayerParserGetTransactionLogId(AppLayerParserState *pstate) SCReturnCT((pstate == NULL) ? 0 : pstate->log_id, "uint64_t"); } +uint64_t AppLayerParserGetMinId(AppLayerParserState *pstate) +{ + SCEnter(); + + SCReturnCT((pstate == NULL) ? 0 : pstate->min_id, "uint64_t"); +} + void AppLayerParserSetTransactionLogId(AppLayerParserState *pstate, uint64_t tx_id) { SCEnter(); diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index 5b90cf2adc..624874c7d3 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -230,6 +230,7 @@ void AppLayerParserDestroyProtocolParserLocalStorage(uint8_t ipproto, AppProto a uint64_t AppLayerParserGetTransactionLogId(AppLayerParserState *pstate); +uint64_t AppLayerParserGetMinId(AppLayerParserState *pstate); void AppLayerParserSetTransactionLogId(AppLayerParserState *pstate, uint64_t tx_id); uint64_t AppLayerParserGetTransactionInspectId(AppLayerParserState *pstate, uint8_t direction);