File 5122-ssh-Handle-raw-option-in-ssh_options.patch of Package erlang

From 61904fa3858c22c1d66959aceda62b44f6341cc9 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Wed, 18 Nov 2020 11:53:03 +0100
Subject: [PATCH 2/3] ssh: Handle raw option in ssh_options

---
 lib/ssh/src/ssh_options.erl | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/ssh/src/ssh_options.erl b/lib/ssh/src/ssh_options.erl
index b27777093b..361c25f2fc 100644
--- a/lib/ssh/src/ssh_options.erl
+++ b/lib/ssh/src/ssh_options.erl
@@ -165,8 +165,13 @@ handle_options(Role, PropList0) ->
                                      }).
 
 handle_options(Role, OptsList0, Opts0) when is_map(Opts0),
-                                            is_list(OptsList0) ->
-    OptsList1 = proplists:unfold(OptsList0),
+                         is_list(OptsList0) ->
+    OptsList1 = proplists:unfold(
+                  lists:foldl(fun(T,Acc) when is_tuple(T),
+                                              size(T) =/= 2-> [{special_trpt_args,T} | Acc];
+                                 (X,Acc) -> [X|Acc]
+                              end,
+                              [], OptsList0)),
     try
         OptionDefinitions = default(Role),
         RoleCnfs = application:get_env(ssh, cnf_key(Role), []),
@@ -286,6 +291,10 @@ save(Inet, Defs, OptMap) when Inet==inet ; Inet==inet6 ->
 save({Inet,true}, Defs, OptMap) when Inet==inet ; Inet==inet6 ->  save({inet,Inet}, Defs, OptMap);
 save({Inet,false}, _Defs, OptMap) when Inet==inet ; Inet==inet6 -> OptMap;
 
+%% There are inet-options that are not a tuple sized 2. They where marked earlier
+save({special_trpt_args,T}, _Defs, OptMap) when is_map(OptMap) ->
+    OptMap#{socket_options := [T | maps:get(socket_options,OptMap)]};
+
 %% and finally the 'real stuff':
 save({Key,Value}, Defs, OptMap) when is_map(OptMap) ->
     try (check_fun(Key,Defs))(Value)
-- 
2.26.2

openSUSE Build Service is sponsored by