summaryrefslogtreecommitdiff
path: root/src/irmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/irmd')
-rw-r--r--src/irmd/main.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index db6f33de..63ae6b13 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -58,6 +58,10 @@
#define SHM_SAN_HOLDOFF 1000 /* ms */
#define IPCP_HASH_LEN(e) hash_len(e->dir_hash_algo)
+#define SHIM_ETH_LLC_HASH_ALGO HASH_SHA3_256
+#define SHIM_UDP_HASH_ALGO HASH_MD5
+#define LOCAL_HASH_ALGO HASH_SHA3_256
+
struct ipcp_entry {
struct list_head next;
@@ -417,6 +421,18 @@ static int bootstrap_ipcp(pid_t api,
return -1;
}
+ if (entry->type == IPCP_LOCAL)
+ entry->dir_hash_algo = conf->dif_info->dir_hash_algo
+ = LOCAL_HASH_ALGO;
+ else if (entry->type == IPCP_SHIM_ETH_LLC)
+ entry->dir_hash_algo = conf->dif_info->dir_hash_algo
+ = SHIM_ETH_LLC_HASH_ALGO;
+ else if (entry->type == IPCP_SHIM_UDP)
+ entry->dir_hash_algo = conf->dif_info->dir_hash_algo
+ = SHIM_UDP_HASH_ALGO;
+ else
+ entry->dir_hash_algo = conf->dif_info->dir_hash_algo;
+
if (ipcp_bootstrap(entry->api, conf)) {
pthread_rwlock_unlock(&irmd.reg_lock);
log_err("Could not bootstrap IPCP.");
@@ -430,8 +446,6 @@ static int bootstrap_ipcp(pid_t api,
return -ENOMEM;
}
- entry->dir_hash_algo = conf->dif_info->dir_hash_algo;
-
pthread_rwlock_unlock(&irmd.reg_lock);
log_info("Bootstrapped IPCP %d in DIF %s.",