summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal
diff options
context:
space:
mode:
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);