summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_ipcp_create.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-26 15:03:00 +0000
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-26 15:03:00 +0000
commitcd6db513e66ad0bccb06b3b36e13824ad03c18ee (patch)
tree5f77626c3ad3b411c1741050f8b24ae498c7de93 /src/tools/irm/irm_ipcp_create.c
parentf60e18adc78afaf4d07a10e6fe8aec3767e0ca11 (diff)
parentaa11e240def809e92d42dcfd0ac934606967583b (diff)
downloadouroboros-cd6db513e66ad0bccb06b3b36e13824ad03c18ee.tar.gz
ouroboros-cd6db513e66ad0bccb06b3b36e13824ad03c18ee.zip
Merged in sandervrijders/ouroboros/be-bind-ipcp (pull request #284)
tools: irm: Bind IPCP name to IPCP-I
Diffstat (limited to 'src/tools/irm/irm_ipcp_create.c')
-rw-r--r--src/tools/irm/irm_ipcp_create.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tools/irm/irm_ipcp_create.c b/src/tools/irm/irm_ipcp_create.c
index e9921112..e152af71 100644
--- a/src/tools/irm/irm_ipcp_create.c
+++ b/src/tools/irm/irm_ipcp_create.c
@@ -47,6 +47,7 @@ int do_create_ipcp(int argc, char ** argv)
char * ipcp_type = NULL;
char * ipcp_name = NULL;
enum ipcp_type type = 0;
+ pid_t api;
while (argc > 0) {
if (matches(*argv, "type") == 0) {
@@ -81,5 +82,12 @@ int do_create_ipcp(int argc, char ** argv)
return -1;
}
- return !irm_create_ipcp(ipcp_name, type);
+ api = irm_create_ipcp(ipcp_name, type);
+ if (api == 0)
+ return -1;
+
+ if (type == IPCP_NORMAL)
+ irm_bind_api(api, ipcp_name);
+
+ return 0;
}