Merge remote-tracking branch 'origin/topic/johanna/l2flip'

BIT-1787 #merged

* origin/topic/johanna/l2flip:
  Fix layer 2 connection flipping.
This commit is contained in:
Robin Sommer 2017-02-03 12:31:55 -08:00
commit bdbbed64f1
4 changed files with 12 additions and 27 deletions

View file

@ -1212,28 +1212,11 @@ Connection* NetSessions::NewConn(HashKey* k, double t, const ConnID* id,
if ( ! WantConnection(src_h, dst_h, tproto, flags, flip) )
return 0;
ConnID flip_id = *id;
if ( flip )
{
// Make a guess that we're seeing the tail half of
// an analyzable connection.
const IPAddr ta = flip_id.src_addr;
flip_id.src_addr = flip_id.dst_addr;
flip_id.dst_addr = ta;
uint32 t = flip_id.src_port;
flip_id.src_port = flip_id.dst_port;
flip_id.dst_port = t;
id = &flip_id;
}
Connection* conn = new Connection(this, k, t, id, flow_label, pkt, encapsulation);
conn->SetTransport(tproto);
if ( flip )
conn->AddHistory('^');
conn->FlipRoles();
if ( ! analyzer_mgr->BuildInitialAnalyzerTree(conn) )
{