anchor.diff:      end,
       %% throw if not ip6 ref
       is_IPv6reference(IPv6Ref),
  -    {"[" ++ IPv6Ref ++ "]", Port}.
  +    {ok, "[" ++ IPv6Ref ++ "]", Port};
  +parse_ipv6hostport(In) ->
  +    %% throw if not ip6 ref
  +    is_IPv6reference(In),
  +    %% XXX return without brackets?
  +    {ok, "[" ++ In ++ "]", none}.
   
   get_ipv6ref_and_port(IPv6Hostport) ->
       case catch sipparse_util:split_fields(IPv6Hostport, 93) of	%% 93 is $]
  
positive.code: 		true ->
  		    %% probably a ipv4 address
  		    case catch parse_ipv4hostport(HostPort) of
  			{error,_} ->
  			    parse_domain_hostport(HostPort);
  			R ->
  			    R
  		    end;
  		false ->
  		    %% must be a domain name
  		    parse_domain_hostport(HostPort)
  	    end
      end.
  
  parse_ipv6hostport([$[ | IPv6Hostport]) ->
      {IPv6Ref, Port} = get_ipv6ref_and_port(IPv6Hostport),
      case Port of
  	none -> ok;
  
negative.code: 	    list_to_integer(Port),
  	    %% throw if not a hostname
  	    is_hostname(Host),
  	    {ok, rm_trailing_dot_from_hostname(Host), Port};
  	{Host} ->
  	    %% throw if not a hostname
  	    is_hostname(Host),
  	    {ok, rm_trailing_dot_from_hostname(Host), none}
      end.
  
  rm_trailing_dot_from_hostname(H) ->
  