anchor.diff:          close({already_connected, Remote, LCaps}, S),
       CER = build_CER(S),
       ?LOG(send, 'CER'),
  -    send(TPid, encode(CER)),
  -    start_timer(S#state{state = 'Wait-CEA'}).
  +    #diameter_packet{header = #diameter_header{end_to_end_id = Eid,
  +                                               hop_by_hop_id = Hid}}
  +        = Pkt
  +        = encode(CER),
  +    send(TPid, Pkt),
  +    start_timer(S#state{state = {'Wait-CEA', Hid, Eid}}).
   
   %% Register ourselves as connecting to the remote endpoint in
   %% question. This isn't strictly necessary since a peer implementing
  
positive.code: %% timeout used to be hardcoded. (So it could be worse.)
  -define(DPA_TIMEOUT, 1000).
  
  -record(state,
          {state = 'Wait-Conn-Ack'   %% state of RFC 3588 Peer State Machine
                :: 'Wait-Conn-Ack' | recv_CER | 'Wait-CEA' | 'Open',
           mode :: accept | connect | {connect, reference()},
           parent       :: pid(),  %% watchdog process
           transport    :: pid(),  %% transport process
           service      :: #diameter_service{},
           dpr = false  :: false | {diameter:'Unsigned32'(),
                                    diameter:'Unsigned32'()}}).
                              %% | hop by hop and end to end identifiers
  
  %% There are non-3588 states possible as a consequence of 5.6.1 of the
  
negative.code: %% rcv/3
  
  %% Incoming CEA.
  rcv('CEA',
      #diameter_packet{header = #diameter_header{end_to_end_id = Eid,
                                                 hop_by_hop_id = Hid}}
      = Pkt,
      #state{state = {'Wait-CEA' = T, Hid, Eid}}
      = S) ->
      handle_CEA(Pkt, S#state{state = T});
  rcv('CEA', Pkt, #state{state = 'Wait-CEA'} = S) ->  %% old code
      handle_CEA(Pkt, S);
  
  %% Incoming CER
  