diff options
-rw-r--r-- | include/ouroboros/irm_config.h | 50 | ||||
-rw-r--r-- | src/lib/btree.c | 5 |
2 files changed, 26 insertions, 29 deletions
diff --git a/include/ouroboros/irm_config.h b/include/ouroboros/irm_config.h index 2be4273e..3cc59e20 100644 --- a/include/ouroboros/irm_config.h +++ b/include/ouroboros/irm_config.h @@ -55,34 +55,28 @@ struct dif_config { char * dif_name; enum ipcp_type type; - union { - /* Normal DIF */ - struct { - uint8_t addr_size; - uint8_t cep_id_size; - uint8_t pdu_length_size; - uint8_t seqno_size; - - bool has_ttl; - bool has_chk; - - uint32_t min_pdu_size; - uint32_t max_pdu_size; - - enum pol_addr_auth addr_auth_type; - enum pol_gam dt_gam_type; - enum pol_gam rm_gam_type; - }; - /* Shim UDP */ - struct { - uint32_t ip_addr; - uint32_t dns_addr; - }; - /* Shim Ethernet LLC */ - struct { - char * if_name; - }; - }; + /* Normal DIF */ + uint8_t addr_size; + uint8_t cep_id_size; + uint8_t pdu_length_size; + uint8_t seqno_size; + + bool has_ttl; + bool has_chk; + + uint32_t min_pdu_size; + uint32_t max_pdu_size; + + enum pol_addr_auth addr_auth_type; + enum pol_gam dt_gam_type; + enum pol_gam rm_gam_type; + + /* Shim UDP */ + uint32_t ip_addr; + uint32_t dns_addr; + + /* Shim Ethernet LLC */ + char * if_name; }; #endif /* OUROBOROS_IRM_CONFIG_H */ diff --git a/src/lib/btree.c b/src/lib/btree.c index 645e7c7a..38302dae 100644 --- a/src/lib/btree.c +++ b/src/lib/btree.c @@ -388,9 +388,12 @@ int btree_insert(struct btree * tree, void * val) { struct btnode * rgt = NULL; - struct key_val kv = {key, val}; + struct key_val kv; struct key_val med; + kv.key = key; + kv.val = val; + if (tree == NULL || val == NULL) return -EINVAL; |