Tunnel decapsulation bugfix when FlipRoles is called.

If FlipRoles() is called the conn_val in Conn.cc gets Unref'ed and thus
my tunnel_partent RecordVal was lost. Fixing this.
This commit is contained in:
Gregor Maier 2011-08-16 20:41:36 -07:00
parent ae1eb5379b
commit 08dc84a250
5 changed files with 64 additions and 37 deletions

View file

@ -1018,11 +1018,8 @@ Connection* NetSessions::NewConn(HashKey* k, double t, const ConnID* id,
int src_h = ntohs(id->src_port);
int dst_h = ntohs(id->dst_port);
int flags = 0;
RecordVal *tunnel_parent = 0;
TunnelParent *tunnel_parent = 0;
if ( tunnel_info )
tunnel_parent = tunnel_info->GetRecordVal();
// Hmm... This is not great.
TransportProto tproto;
switch ( proto ) {
@ -1068,6 +1065,9 @@ Connection* NetSessions::NewConn(HashKey* k, double t, const ConnID* id,
id = &flip_id;
}
if ( tunnel_info )
tunnel_parent = new TunnelParent(&(tunnel_info->parent));
Connection* conn = new Connection(this, k, t, id, tunnel_parent);
conn->SetTransport(tproto);
dpm->BuildInitialAnalyzerTree(tproto, conn, data);