summaryrefslogtreecommitdiff
path: root/src/ipcpd/eth
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2021-06-18 17:37:11 +0200
committerSander Vrijders <sander@ouroboros.rocks>2021-06-21 08:45:25 +0200
commit1a13d42a0792a4a12a40c813072355502e87c42f (patch)
tree9c86f115e7f511482d178956f67af432aa9ee39a /src/ipcpd/eth
parent7b13504e2a47a40ae7e5283de41d48ca3f7efb53 (diff)
downloadouroboros-1a13d42a0792a4a12a40c813072355502e87c42f.tar.gz
ouroboros-1a13d42a0792a4a12a40c813072355502e87c42f.zip
ipcpd: Move RIB initialization to common ground
This moves Resource Information Base (RIB) initialization into the ipcp_init() function, so all IPCPs initialize a RIB. The RIB not shows some common IPCP information, such as the IPCP name, IPCP state and the layer name if the IPCP is part of a layer. The initialization of the hash algorithm and layer name was moved out of the common ipcp source because IPCPs may only know this information after enrollment. Some IPCPs were not even storing this information. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/eth')
-rw-r--r--src/ipcpd/eth/eth.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index a1eeb3fa..13a4a7e3 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -1283,6 +1283,13 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf)
assert(conf);
assert(conf->type == THIS_TYPE);
+ ipcpi.dir_hash_algo = conf->layer_info.dir_hash_algo;
+ ipcpi.layer_name = strdup(conf->layer_info.layer_name);
+ if (ipcpi.layer_name == NULL) {
+ log_err("Failed to set layer name");
+ return -ENOMEM;
+ }
+
if (conf->dev == NULL) {
log_err("Device name is NULL.");
return -1;
@@ -1833,7 +1840,7 @@ int main(int argc,
{
int i;
- if (ipcp_init(argc, argv, &eth_ops) < 0)
+ if (ipcp_init(argc, argv, &eth_ops, THIS_TYPE) < 0)
goto fail_init;
if (eth_data_init() < 0) {