diff options
Diffstat (limited to 'hicn-light/src/hicn/config')
-rw-r--r-- | hicn-light/src/hicn/config/command.h | 6 | ||||
-rw-r--r-- | hicn-light/src/hicn/config/configuration.c | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/hicn-light/src/hicn/config/command.h b/hicn-light/src/hicn/config/command.h index 4cc770e0d..ddeb94b03 100644 --- a/hicn-light/src/hicn/config/command.h +++ b/hicn-light/src/hicn/config/command.h @@ -13,7 +13,7 @@ /* Update sscanf accordingly in parse_cmd.c */ #define MAX_PARAMETERS 10 -#define MAX_SCANF_PARAM_LEN 10 +#define MAX_SCANF_PARAM_LEN 100 typedef int (*parser_hook_t)(void * arg); @@ -126,7 +126,7 @@ typedef struct { }, \ } /* We need to allocate room for the intermediate string */ -#define TYPE_FMT_ENUM "%ms" +#define TYPE_FMT_ENUM "%s" #define TYPE_POLICY_STATE(TAG) (parser_type_t) { \ .name = TYPENAME_POLICY_STATE, \ @@ -135,7 +135,7 @@ typedef struct { }, \ } /* We need to allocate room for the intermediate string */ -#define TYPE_FMT_POLICY_STATE "%ms" +#define TYPE_FMT_POLICY_STATE "%s" /** * \brief Register a protocol diff --git a/hicn-light/src/hicn/config/configuration.c b/hicn-light/src/hicn/config/configuration.c index 591352377..f56ce73ce 100644 --- a/hicn-light/src/hicn/config/configuration.c +++ b/hicn-light/src/hicn/config/configuration.c @@ -198,8 +198,10 @@ configuration_on_listener_add(configuration_t * config, uint8_t * packet, /* Verify that the listener DOES NOT exist */ listener_t * listener = listener_table_get_by_name(table, control->symbolic); - if (listener) + if (listener) { + DEBUG("Listener %s already exists", control->symbolic); goto NACK; + } address_t address; if (address_from_ip_port(&address, control->family, &control->address, @@ -384,10 +386,9 @@ configuration_on_connection_add(configuration_t * config, uint8_t * packet, const char *symbolic_name = control->symbolic; - face_type_t face_type; - if (!face_type_is_defined(control->type)) + face_type_t face_type = get_face_type_from_listener_type((hc_connection_type_t) control->type); + if (!face_type_is_defined(face_type)) goto NACK; - face_type = (face_type_t)control->type; connection_table_t * table = forwarder_get_connection_table(config->forwarder); if (connection_table_get_by_name(table, symbolic_name)) { |