anchor.diff:  %%                   the result of a call to dnsutil:get_ip_port()
   %% Descrip.: Turns the result of a dnsutil:get_ip_port() into a list
   %%           of sipdst records. get_ip_port() return a list of tuples
  -%%           like {IP, Addr, Port} where IP is a string ("10.0.0.1",
  -%%           "[2001:6b0:5:987::1]") and Addr is the same IP but in
  -%%           tuple representation. This allows us to easily determine
  -%%           if it is a IPv4 or IPv6 address, and to convert Proto as
  -%%           necessary.
  +%%           like {Inet, Addr, Port} where IP is a string ("10.0.0.1",
  +%%           "[2001:6b0:5:987::1]"). Inet is 'inet' or 'inet6' and
  +%%           we need to know to convert Proto as necessary. The order
  +%%           of the input tuples is preserved in the resulting list.
   %% Returns : DstList | {error, Reason}
   %%           DstList = list() of sipdst record()
  -%%--------------------------------------------------------------------
  -make_sipdst_from_hostport(Proto, URI, L) ->
  +%%           Reason  = string()
  +%%--------------------------------------------------------------------
  +make_sipdst_from_hostport(Proto, URI, L) when Proto == tcp; Proto == udp; Proto == tls,
  +					      is_record(URI, sipurl), is_list(L) ->
       make_sipdst_from_hostport2(Proto, URI, L, []).
   
   make_sipdst_from_hostport2(_Proto, _URI, [], Res) ->
  -    Res;
  +    lists:reverse(Res);
   make_sipdst_from_hostport2(Proto, URI, [{inet, Addr, Port} | T], Res) ->
       UsePort = siprequest:default_port(Proto, Port),
       Dst = #sipdst{proto=Proto, addr=Addr, port=UsePort, uri=URI},
  -    make_sipdst_from_hostport2(Proto, URI, T, lists:append(Res, [Dst]));
  +    make_sipdst_from_hostport2(Proto, URI, T, [Dst | Res]);
   make_sipdst_from_hostport2(Proto, URI, [{inet6, Addr, Port} | T], Res) ->
       NewProto = case Proto of
   		   tcp -> tcp6;
  
positive.code: %%% File    : sipdst.erl
  %%% Author  : Fredrik Thulin <ft@t.su.se>
  %%% Description : Functions to resolve URL's or Via headers into
  %%%               sipdst records.
  %%% Created : 15 Apr 2004 by Fredrik Thulin <ft@it.su.se>
  
  -module(sipdst).
  
  -export([
  	 url_to_dstlist/3,
  	 get_response_destination/1,
  	 dst2str/1,
  	 debugfriendly/1
  	]).
  
  -include("siprecords.hrl").
  -include("sipsocket.hrl").
  
  
  %%--------------------------------------------------------------------
  %% Function: url_to_dstlist(URL, ApproxMsgSize, ReqURI)
  
negative.code: 		    logger:log(debug, "Warning: ~p has no SRV records in DNS, and the message size" ++
  			       "is > 1200 bytes. Resolving hostname and trying TCP and then UDP.",
  			       [URL#sipurl.host]),
  		    combine_host_portres([TCP, UDP]);
  		false ->
  		    logger:log(debug, "Warning: ~p has no SRV records in DNS. Resolving hostname " ++
  			       "and defaulting to UDP (only).", [URL#sipurl.host]),
  