From b8c73d171d4352293b18ddbc71c587233d1f2fa5 Mon Sep 17 00:00:00 2001
From: Dimitri Staessens <dimitri.staessens@ugent.be>
Date: Fri, 12 Oct 2018 16:56:45 +0200
Subject: lib: Set hash algorithm correctly

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@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
---
 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 d88475c4..384da7b0 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;
-- 
cgit v1.2.3