Merge in SNORT/snort3 from ~RUCOMBS/snort3:sync_on_start to master
Squashed commit of the following:
commit
fcd5a8de59569044555cc7d8bd987506767e53f3
Author: russ <rucombs@cisco.com>
Date: Tue Apr 26 14:28:15 2022 -0400
stream_tcp, pop: add sync_on_start method to StreamSplitter
This is used to force a flush of data from the client when the wizard
identifies a flow by data from the server. The new virtual defaults
to false and pop overrides to true to handle the case where jumpy
clients send a command before the server greeting. Other, similar
overrides are anticipated.
};
-static void snort_pop(POP_PROTO_CONF* GlobalConf, Packet* p);
-static void POP_ResetState(Flow*);
-
PopFlowData::PopFlowData() : FlowData(inspector_id)
{
memset(&session, 0, sizeof(session));
Status scan(snort::Packet*, const uint8_t* data, uint32_t len,
uint32_t flags, uint32_t* fp) override;
- bool is_paf() override { return true; }
+ bool is_paf() override
+ { return true; }
+
+ bool sync_on_start() const override
+ { return true; }
public:
PopPafData state;
unsigned& copied // actual data copied (1 <= copied <= len)
);
+ virtual bool sync_on_start() const { return false; }
virtual bool is_paf() { return false; }
virtual unsigned max(Flow* = nullptr);
virtual void go_away() { delete this; }
{
talker = &server;
listener = &client;
+
+ if ( server.get_splitter()->sync_on_start() )
+ flush_tracker(server, p, PKT_FROM_CLIENT, false);
}
else
{