summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-08-10 15:33:36 +0200
committerSander Vrijders <[email protected]>2017-08-10 15:44:09 +0200
commitcf18d69d1e8b238c82940b4ea8173436bd53a1ce (patch)
tree072770c8575c0f5d8248ff5a4a3afa4388fe455c
parentf3d2ce1e668dfcf6b5088bf448b29f96d0ddaa76 (diff)
downloadouroboros-cf18d69d1e8b238c82940b4ea8173436bd53a1ce.tar.gz
ouroboros-cf18d69d1e8b238c82940b4ea8173436bd53a1ce.zip
lib, ipcpd, tools: Fix enum assignments
This fixes several assignments to the wrong enum type.
-rw-r--r--include/ouroboros/ipcp.h4
-rw-r--r--src/ipcpd/ipcp.c5
-rw-r--r--src/ipcpd/normal/dht.c2
-rw-r--r--src/tools/irm/irm_ipcp_bootstrap.c11
4 files changed, 8 insertions, 14 deletions
diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h
index 7c34cc7d..2be47f2d 100644
--- a/include/ouroboros/ipcp.h
+++ b/include/ouroboros/ipcp.h
@@ -63,8 +63,8 @@ enum pol_dir_hash {
/* Info reported back to the IRMd about the DIF on enrollment */
struct dif_info {
- char dif_name[DIF_NAME_SIZE];
- enum pol_dir_hash dir_hash_algo;
+ char dif_name[DIF_NAME_SIZE];
+ int dir_hash_algo;
};
/* Structure to configure the first IPCP */
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c
index b2afdf99..b54bf0b7 100644
--- a/src/ipcpd/ipcp.c
+++ b/src/ipcpd/ipcp.c
@@ -174,11 +174,6 @@ static void * mainloop(void * o)
conf.type = conf_msg->ipcp_type;
strcpy(conf.dif_info.dif_name,
conf_msg->dif_info->dif_name);
- if (conf.dif_info.dif_name == NULL) {
- log_err("No DIF name provided.");
- ret_msg.result = -1;
- break;
- }
if (conf_msg->ipcp_type == IPCP_NORMAL) {
conf.addr_size = conf_msg->addr_size;
conf.fd_size = conf_msg->fd_size;
diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c
index 954ca670..5c294c00 100644
--- a/src/ipcpd/normal/dht.c
+++ b/src/ipcpd/normal/dht.c
@@ -630,7 +630,7 @@ static void lookup_destroy(struct lookup * lu)
case LU_DONE:
case LU_UPDATE:
case LU_COMPLETE:
- lu->state = REQ_NULL;
+ lu->state = LU_NULL;
break;
case LU_NULL:
default:
diff --git a/src/tools/irm/irm_ipcp_bootstrap.c b/src/tools/irm/irm_ipcp_bootstrap.c
index 571bff8b..48a31f08 100644
--- a/src/tools/irm/irm_ipcp_bootstrap.c
+++ b/src/tools/irm/irm_ipcp_bootstrap.c
@@ -29,7 +29,6 @@
#endif
#include <ouroboros/irm.h>
#include <ouroboros/ipcp.h>
-#include <ouroboros/hash.h>
#include "irm_ops.h"
#include "irm_utils.h"
@@ -52,7 +51,7 @@
#define DEFAULT_DT_GAM COMPLETE
#define DEFAULT_RM_GAM COMPLETE
#define DEFAULT_ROUTING LINK_STATE
-#define DEFAULT_HASH_ALGO HASH_SHA3_256
+#define DEFAULT_HASH_ALGO DIR_HASH_SHA3_256
#define ADDR_AUTH_FLAT "flat"
#define DT_GAM_COMPLETE "complete"
#define RM_GAM_COMPLETE "complete"
@@ -122,13 +121,13 @@ int do_bootstrap_ipcp(int argc, char ** argv)
name = *(argv + 1);
} else if (matches(*argv, "hash") == 0) {
if (strcmp(*(argv + 1), SHA3_224) == 0)
- hash_algo = HASH_SHA3_224;
+ hash_algo = DIR_HASH_SHA3_224;
else if (strcmp(*(argv + 1), SHA3_256) == 0)
- hash_algo = HASH_SHA3_256;
+ hash_algo = DIR_HASH_SHA3_256;
else if (strcmp(*(argv + 1), SHA3_384) == 0)
- hash_algo = HASH_SHA3_384;
+ hash_algo = DIR_HASH_SHA3_384;
else if (strcmp(*(argv + 1), SHA3_512) == 0)
- hash_algo = HASH_SHA3_512;
+ hash_algo = DIR_HASH_SHA3_512;
else
goto unknown_param;
} else if (matches(*argv, "ip") == 0) {