[PATCH] lib: Set hash algorithm correctly

  • From: Dimitri Staessens <dimitri.staessens@xxxxxxxx>
  • To: ouroboros@xxxxxxxxxxxxx
  • Date: Fri, 12 Oct 2018 16:56:45 +0200

There was a bug where the hash selection for the local, raptor and
ethernet IPCPs was not passed correctly, so they were using a wrong
hash.

Signed-off-by: Dimitri Staessens <dimitri.staessens@xxxxxxxx>
---
 src/lib/irm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/irm.c b/src/lib/irm.c
index d88475c..384da7b 100644
--- a/src/lib/irm.c
+++ b/src/lib/irm.c
@@ -117,6 +117,9 @@ int irm_bootstrap_ipcp(pid_t                      pid,
 
         config.ipcp_type = conf->type;
 
+        if (conf->type != IPCP_UDP)
+                layer_info.dir_hash_algo  = conf->layer_info.dir_hash_algo;
+
         switch (conf->type) {
         case IPCP_NORMAL:
                 config.has_addr_size      = true;
@@ -131,7 +134,6 @@ int irm_bootstrap_ipcp(pid_t                      pid,
                 config.routing_type       = conf->routing_type;
                 config.has_pff_type       = true;
                 config.pff_type           = conf->pff_type;
-                layer_info.dir_hash_algo  = conf->layer_info.dir_hash_algo;
                 break;
         case IPCP_UDP:
                 config.has_ip_addr  = true;
-- 
2.19.1


Other related posts:

  • » [PATCH] lib: Set hash algorithm correctly - Dimitri Staessens