anchor.diff:  %% API
   -export([answer/3, answer/4]).
   
  --record(ctx, {now, rr, zonename, names, cuts, followed_names = [],
  -	      soa, dnssec, dnssec_keys, nsec3, cur_serial, next_serial}).
  +-record(ctx, {now, rr, zonename, names, cuts, soa, dnssec, dnssec_keys, nsec3,
  +	      cur_serial, next_serial}).
   
   %%%===================================================================
   %%% API
  
positive.code:     end;
  match_down(_, _, _) -> nomatch.
  
  match_cname(#ctx{}, [#dnsxd_rr{type = cname,
  			       data = #dns_rrdata_cname{dname = Next}}] = RR) ->
      {true, RR, Next};
  match_cname(#ctx{}, _) -> false.
  
  build_names(ZoneName, RRs) -> build_names(ZoneName, [ZoneName], RRs).
  
  build_names(_ZoneName, Names, []) -> lists:usort(Names);
  
negative.code: 	    <<QLabelsBin:QLabelsSize/binary, $., ZoneName/binary>> = Name,
  	    QLabels = lists:reverse(dns:dname_to_labels(QLabelsBin)),
  	    case match_down(Ctx, ZoneName, QLabels) of
  		{match, [#dnsxd_rr{type = ?DNS_TYPE_CNAME}] = An} ->
  		    au(Ctx, An);
  		{match, MatchRRs} ->
  		    An = [ RR#dnsxd_rr{name = NameM}
  			   || #dnsxd_rr{} = RR <- MatchRRs,
  			      match_qtype(Ctx, Type, RR) ],
  		    case An of
  			[] ->
  			    NSEC3 = add_nsec3(false, Ctx, Query, [SOA]),
  			    FinalAn = sign(Ctx, NSEC3),
  			    {noerror, [], FinalAn, []};
  			_ -> au(Ctx, An)
  		    end;
  		{referral, RefRRs} ->
  		    An = [],
  		    ad(Ctx, An, RefRRs);
  		nomatch ->
  		    %% no name
  		    FinalAn = sign(Ctx, add_nsec3(true, Ctx, Query, [SOA])),
  		    {nxdomain, [], FinalAn, []}
  	    end
      end.
  
  