anchor.diff:          S#state.rport, uint32(), S#state.seq, S#state.id]).
   
   syn_ack_pre(Ss, [Ip, Port, RIp, RPort, _, Seq, Id]) ->
  -  [ S ] = [ S || S<-Ss, S#state.id == Id ],
  -  in_tcp_state(Ss, Id, syn_sent) andalso
  -    S#state.rcvd == S#state.seq andalso
  -    Ip    == S#state.ip    andalso
  -    Port  == S#state.port  andalso
  -    RIp   == S#state.rip   andalso
  -    RPort == S#state.rport andalso
  -    Seq   == S#state.seq.
  +  case [ S || S<-Ss, S#state.id == Id ] of
  +    [ S ] ->
  +      in_tcp_state(Ss, Id, syn_sent) andalso
  +        S#state.rcvd == S#state.seq andalso
  +        Ip    == S#state.ip    andalso
  +        Port  == S#state.port  andalso
  +        RIp   == S#state.rip   andalso
  +        RPort == S#state.rport andalso
  +        Seq   == S#state.seq;
  +    _ ->
  +      false
  +  end.
   
   syn_ack_adapt(Ss, [_, _, _, _, Seq, _, Id]) ->
  -  [ S ] = [ S || S<-Ss, S#state.id == Id ],
  -  [S#state.ip, S#state.port, S#state.rip,
  -   S#state.rport, Seq, S#state.seq, Id].
  +  case [ S || S<-Ss, S#state.id == Id ] of
  +    [ S ] ->
  +      [S#state.ip, S#state.port, S#state.rip,
  +       S#state.rport, Seq, S#state.seq, Id];
  +    _ ->
  +      false
  +  end.
   
   syn_ack(Ip, Port, RemoteIp, RemotePort, Seq, Ack, _) ->
     Packet =
  
positive.code:   ok.
  
  syn_pre(Ss, [Ip, Port, _, _, _, Id]) ->
    [ S ] = [ S || S<-Ss, S#state.id == Id ],
    S#state.ip   == Ip andalso
    S#state.port == Port andalso
      in_tcp_state(Ss, Id, listen).
  
  syn_adapt(Ss, [_, _, Ip, Port, Seq, Id]) ->
    [ S ] = [ S || S<-Ss, S#state.id == Id ],
    [S#state.ip, S#state.port, Ip, Port, Seq, Id].
  
  syn_callouts(_S, [_Ip,  _Port, RemoteIp, RemotePort, RemoteSeq, Id]) ->
    ?SET(Id, rip, RemoteIp),
  
negative.code:     in_tcp_state(Ss, Id, [listen, syn_rcvd, established, close_wait]).
  
  accept_adapt(Ss, [_, Id]) -> 
   case  [ S || S<-Ss, S#state.id == Id ] of
     [S] ->
       [S#state.socket, Id];
     _ ->
       false
   end.
  
  accept(Socket, _) ->
    mock:set_socket(tcp_con:usr_accept(Socket)).
  