anchor.diff:  connect(Host, Port, Options) ->
       connect(Host, Port, Options, infinity).
   connect(Host, Port, Options, Timeout) ->
  -    {SocketOpts, Opts} = handle_options(Options),
  -    DisableIpv6 =  proplists:get_value(ip_v6_disabled, Opts, false),
  -    Inet = inetopt(DisableIpv6),
  +    case handle_options(Options) of
  +	{error, _Reason} = Error ->
  +	    Error;
  +	{SocketOptions, SshOptions} ->
  +	    DisableIpv6 =  proplists:get_value(ip_v6_disabled, SshOptions, false),
  +	    Inet = inetopt(DisableIpv6),
  +	    do_connect(Host, Port, [Inet | SocketOptions], 
  +		       [{host, Host} | SshOptions], Timeout, DisableIpv6)
  +    end.
  +
  +do_connect(Host, Port, SocketOptions, SshOptions, Timeout, DisableIpv6) ->
       try sshc_sup:start_child([[{address, Host}, {port, Port}, 
  -			      {role, client},
  -			      {channel_pid, self()},
  -			      {socket_opts, [Inet | SocketOpts]}, 
  -			      {ssh_opts, [{host, Host}| Opts]}]]) of 
  +			       {role, client},
  +			       {channel_pid, self()},
  +			       {socket_opts, SocketOptions}, 
  +			       {ssh_opts, SshOptions}]]) of 
    	{ok, ConnectionSup} ->
   	    {ok, Manager} = 
   		ssh_connection_controler:connection_manager(ConnectionSup),
  
positive.code:     end.
  
  handle_options(Opts) ->
      handle_options(proplists:unfold(Opts), [], []).
  handle_options([], SockOpts, Opts) ->
      {SockOpts, Opts};
  %% TODO: Could do some type checks here on plain ssh-opts
  handle_options([{system_dir, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{user_dir, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{user_dir_fun, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{silently_accept_hosts, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{user_interaction, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{public_key_alg, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{connect_timeout, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{user, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{dsa_pass_phrase, _} = Opt | Rest], SockOpts, Opts) ->
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{rsa_pass_phrase, _} = Opt | Rest], SockOpts, Opts) ->
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{password, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{user_passwords, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{pwdfun, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{user_auth, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{key_cb, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{role, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{channel, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{compression, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{allow_user_interaction, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{infofun, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{connectfun, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{disconnectfun , _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{failfun, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{ip_v6_disabled, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, SockOpts, [Opt | Opts]);
  handle_options([{ip, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, [Opt |SockOpts], Opts);
  handle_options([{ifaddr, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, [Opt |SockOpts], Opts);
  handle_options([{fd, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, [Opt | SockOpts], Opts);
  handle_options([{nodelay, _} = Opt | Rest], SockOpts, Opts) -> 
      handle_options(Rest, [Opt | SockOpts], Opts);
  handle_options([Opt | Rest], SockOpts, Opts) ->
      handle_options(Rest, SockOpts, [Opt | Opts]).
  
  %% Has IPv6 been disabled?
  inetopt(true) ->
  
negative.code: 	    %% monent. The name is a legacy name!
  	    try sshd_sup:start_child([{address, Host}, 
  				      {port, Port}, {role, server},
  				      {socket_opts, SocketOptions}, 
  				      {ssh_opts, Options}]) of
  		{ok, SysSup} ->
  		    {ok, SysSup};
  		{error, {already_started, _}} ->
  