diff --git a/src/app-layer-dnp3.c b/src/app-layer-dnp3.c index be682bb019..c1ce7898f0 100644 --- a/src/app-layer-dnp3.c +++ b/src/app-layer-dnp3.c @@ -298,6 +298,11 @@ static uint16_t DNP3ProbingParser(Flow *f, uint8_t direction, } end: + // Test compatibility between direction and dnp3.ctl.direction + if ((DNP3_LINK_DIR(hdr->control) != 0) ^ + ((direction & STREAM_TOCLIENT) != 0)) { + *rdir = 1; + } SCLogDebug("Detected DNP3."); return ALPROTO_DNP3; }