anchor.diff:      end.
   
   %%%----------------------------------------------------------------
  +map_ip(Fun, {address,IP}) when is_tuple(IP) ->
  +    Fun(IP);
  +map_ip(Fun, {address,Address}) ->
  +    IPs = try {ok,#hostent{h_addr_list=IP0s}} = inet:gethostbyname(Address),
  +               IP0s
  +          catch
  +              _:_ -> []
  +          end,
  +    map_ip(Fun, IPs);
  +map_ip(Fun, IPs) ->
  +    lists:map(Fun, IPs).
  +
  +%%%----------------------------------------------------------------
  +mangle_connect_address(A, SockOpts) ->
  +    mangle_connect_address1(A, proplists:get_value(inet6,SockOpts,false)).
  +
  +loopback(true) -> {0,0,0,0,0,0,0,1};
  +loopback(false) ->      {127,0,0,1}.
  +
  +mangle_connect_address1( loopback,     V6flg) -> loopback(V6flg);
  +mangle_connect_address1(      any,     V6flg) -> loopback(V6flg);
  +mangle_connect_address1({0,0,0,0},         _) -> loopback(false);
  +mangle_connect_address1({0,0,0,0,0,0,0,0}, _) -> loopback(true);
  +mangle_connect_address1(       IP,     _) when is_tuple(IP) -> IP;
  +mangle_connect_address1(A, _) ->
  +    case catch inet:parse_address(A) of
  +        {ok,         {0,0,0,0}} -> loopback(false);
  +        {ok, {0,0,0,0,0,0,0,0}} -> loopback(true);
  +        _ -> A
  +    end.
  
positive.code: daemon_info(Pid) ->
      case catch ssh_system_sup:acceptor_supervisor(Pid) of
  	AsupPid when is_pid(AsupPid) ->
  	    [{Name,Port,Profile}] =
  		[{Nam,Prt,Prf} 
                   || {{ssh_acceptor_sup,Hst,Prt,Prf},_Pid,worker,[ssh_acceptor]} 
                          <- supervisor:which_children(AsupPid),
                      Nam <- [case inet:parse_strict_address(Hst) of
                                  {ok,IP} -> IP;
                                  _ when Hst=="any" -> any;
                                  _ when Hst=="loopback" -> loopback;
                                  _ -> Hst
                              end]
                  ],
  	    {ok, [{port,Port},
                    {name,Name},
                    {profile,Profile}
                   ]};
  	_ ->
  	    {error,bad_daemon_ref}
      end.
  
  
  
  %%--------------------------------------------------------------------
  -spec stop_listener(daemon_ref()) -> ok.
  -spec stop_listener(inet:ip_address(), inet:port_number()) -> ok.
  
negative.code:     end.
  
  %%%----------------------------------------------------------------
  open_listen_socket(_Host0, Port0, Options0) ->
      {ok,LSock} =
          case ?GET_SOCKET_OPT(fd, Options0) of
              undefined ->
                  ssh_acceptor:listen(Port0, Options0);
              Fd when is_integer(Fd) ->
                  %% Do gen_tcp:listen with the option {fd,Fd}:
                  ssh_acceptor:listen(0, Options0)
          end,
      {ok,{LHost,LPort}} = inet:sockname(LSock),
      {{LHost,LPort}, LSock}.
  
  %%%----------------------------------------------------------------
  finalize_start(Host, Port, Profile, Options0, F) ->
  