summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_ipcp_bootstrap.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-08-10 11:25:45 +0200
committerSander Vrijders <[email protected]>2016-08-10 11:25:45 +0200
commit6e854784ebc67af1eb8cdc3209f574e0af5e574d (patch)
tree8e60459dc429beb9964da77695576cd7a98a7464 /src/tools/irm/irm_ipcp_bootstrap.c
parent822dfbd3c41e9815361d1199afc9775b091d7456 (diff)
downloadouroboros-6e854784ebc67af1eb8cdc3209f574e0af5e574d.tar.gz
ouroboros-6e854784ebc67af1eb8cdc3209f574e0af5e574d.zip
tools: irm: Create IPCP on bootstrap if unexisting
If the admin tries to bootstrap an IPCP that does not yet exist, it will first create the IPCP, then bootstrap it since it has all required information.
Diffstat (limited to 'src/tools/irm/irm_ipcp_bootstrap.c')
-rw-r--r--src/tools/irm/irm_ipcp_bootstrap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tools/irm/irm_ipcp_bootstrap.c b/src/tools/irm/irm_ipcp_bootstrap.c
index d5fa97da..34c5d223 100644
--- a/src/tools/irm/irm_ipcp_bootstrap.c
+++ b/src/tools/irm/irm_ipcp_bootstrap.c
@@ -184,12 +184,17 @@ int do_bootstrap_ipcp(int argc, char ** argv)
}
len = irm_list_ipcps(name, &apis);
- if (len <= 0)
- return -1;
+ if (len <= 0) {
+ if (!irm_create_ipcp(name, conf.type))
+ return -1;
+ len = irm_list_ipcps(name, &apis);
+ }
for (i = 0; i < len; i++)
if (irm_bootstrap_ipcp(apis[i], &conf))
return -1;
+ free(apis);
+
return 0;
}