From 00f0606c3b4e74e768ab250bf04572afe178b4f6 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 26 Oct 2016 16:59:04 +0200 Subject: tools: irm: Bind IPCP name to IPCP-I This will invoke the bind operation when using the irm tool to create a new IPCP. The new IPCP will be bound to the IPCP name as specified by the administrator. --- src/tools/irm/irm_ipcp_create.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/tools/irm/irm_ipcp_create.c') 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; } -- cgit v1.2.3