anchor.diff:  %%
   %% Turn the result code into a list if its optional and only set it if
   %% the arity is 1 or {0,1}. In other cases (which probably shouldn't
  -%% exist in practise) we can't know what's appropriate.
  -
  -rc(_, B, _)
  -  when is_boolean(B) ->
  -    [];
  +%% exist in practice) we can't know what's appropriate.
   
   rc([MsgName | _], RC, Dict) ->
       K = 'Result-Code',
  
positive.code:                                   is_retransmitted = false},
      fold_record(Hdr0, Hdr).
  
  %% Reply as name and tuple list ...
  set([_|_] = Ans, Avps, _) ->
      Ans ++ Avps;  %% Values nearer tail take precedence.
  
negative.code: %%   indicated by the Result-Code AVP.  For practical purposes, this
  %%   Failed-AVP would typically refer to the first AVP processing error
  %%   that a Diameter node encounters.
  %%
  %% 3xxx can only be set in an answer setting the E-bit. RFC 6733 also
  %% allows 5xxx, RFC 3588 doesn't.
  
  select_error(E, [{RC, _} = T | Es], Dict0) ->
      select(E, RC, T, Es, Dict0);
  
  select_error(E, [RC | Es], Dict0) ->
      select(E, RC, RC, Es, Dict0);
  
  select_error(_, [] = No, _) ->
      No.
  
  select(E, RC, T, _, Dict0)
    when E, 3000 =< RC, RC < 4000;                 %% E-bit with 3xxx
         E, ?BASE /= Dict0, 5000 =< RC, RC < 6000; %% E-bit with 5xxx
         not E, RC < 3000 orelse 4000 =< RC ->     %% no E-bit
      [T];
  
  select(E, _, _, Es, Dict0) -> 
      select_error(E, Es, Dict0).
  
  %% eval_packet/2
  
  eval_packet(Pkt, Fs) ->
      lists:foreach(fun(F) -> diameter_lib:eval([F,Pkt]) end, Fs).
  
  %% make_answer_packet/4
  
  %% Use decode errors to set Result-Code and/or Failed-AVP unless the
  %% the errors field has been explicitly set. Unfortunately, the
  