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: 	    list_to_integer(Port),
  	    %% throw if not a hostname
  	    is_hostname(Host),
  	    {rm_trailing_dot_from_hostname(Host), Port};
  	{Host} ->
  	    %% throw if not a hostname
  	    is_hostname(Host),
  	    {rm_trailing_dot_from_hostname(Host), none}
      end.
  
  rm_trailing_dot_from_hostname(H) ->
  
negative.code:     %% IPv6 host and no port
      io:format("test: parse_hostport/1 - 7~n"),
      {"[1:2:3:4:5:6:7:8]", none} = sipparse_util:parse_hostport("[1:2:3:4:5:6:7:8]"),
      %% IPv6 address not starting with digit
      io:format("test: parse_hostport/1 - 8~n"),
      {"[ab:CD:3::5:6:7:8]", none} = sipparse_util:parse_hostport("[ab:CD:3::5:6:7:8]"),
      %% IPv6 host and no port, no brackets
      io:format("test: parse_hostport/1 - 9~n"),
      {"[1:2:3:4:5:6:7:8]", none} = sipparse_util:parse_hostport("1:2:3:4:5:6:7:8"),
      %% IPv6 host and no port, no brackets
      io:format("test: parse_hostport/1 - 10~n"),
      {"[abcd:2:3:4:5:6:7:8]", none} = sipparse_util:parse_hostport("abcd:2:3:4:5:6:7:8"),
      %% IPv6 host and no port, no brackets
      io:format("test: parse_hostport/1 - 11~n"),
      {"[1:2::8]", none} = sipparse_util:parse_hostport("1:2::8"),
      %% IPv6 host and no port, no brackets
      io:format("test: parse_hostport/1 - 12~n"),
      {"[abcd:2::6:7:8]", none} = sipparse_util:parse_hostport("abcd:2::6:7:8"),
      %% IPv6 host and no port, no brackets
      io:format("test: parse_hostport/1 - 13~n"),
      {"[abcd:2::6:BCDE:8]", none} = sipparse_util:parse_hostport("abcd:2::6:BCDE:8"),
      %% test bad port value
      io:format("test: parse_hostport/1 - 14~n"),
      case catch sipparse_util:parse_hostport("1.1.1.1:1A1") of
  	{'EXIT', _} -> ok;
  	{error, _} -> ok;
  