summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-01-29 12:24:35 +0000
committerSander Vrijders <[email protected]>2017-01-29 12:24:35 +0000
commit9a744bc8f0511f03534dca7ce5589f031c5105b3 (patch)
tree14c3f3aa49f62706d5bcf7cd5e87698956a9a599 /src/ipcpd/normal
parentcfc1e421cd222f41dd1c8498d631a31c680e4211 (diff)
parent1f94baea43c031c366decb9c772514a89a7fa372 (diff)
downloadouroboros-9a744bc8f0511f03534dca7ce5589f031c5105b3.tar.gz
ouroboros-9a744bc8f0511f03534dca7ce5589f031c5105b3.zip
Merged in dstaesse/ouroboros/be-ipcpd (pull request #352)
ipcpd: Don't strdup() the dif_name in main loop
Diffstat (limited to 'src/ipcpd/normal')
-rw-r--r--src/ipcpd/normal/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index 85f56ab0..c1bae0d6 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -218,6 +218,13 @@ static int normal_ipcp_bootstrap(struct dif_config * conf)
return -1; /* -ENOTINIT */
}
+ ipcpi.data->dif_name = strdup(conf->dif_name);
+ if (ipcpi.data->dif_name == NULL) {
+ pthread_rwlock_unlock(&ipcpi.state_lock);
+ LOG_ERR("Failed to set DIF name.");
+ return -1;
+ }
+
if (ribmgr_init()) {
LOG_ERR("Failed to initialise RIB manager.");
pthread_rwlock_unlock(&ipcpi.state_lock);
@@ -273,8 +280,6 @@ static int normal_ipcp_bootstrap(struct dif_config * conf)
return -1;
}
- ipcpi.data->dif_name = conf->dif_name;
-
pthread_rwlock_unlock(&ipcpi.state_lock);
LOG_DBG("Bootstrapped in DIF %s.", conf->dif_name);