diff options
Diffstat (limited to 'src/lib/irm.c')
-rw-r--r-- | src/lib/irm.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/irm.c b/src/lib/irm.c index da229d3e..1af8ed2c 100644 --- a/src/lib/irm.c +++ b/src/lib/irm.c @@ -31,7 +31,8 @@ int irm_create_ipcp(rina_name_t name, char * ipcp_type) { int sockfd; - struct irm_msg_sock msg; + struct irm_msg msg; + buffer_t * buf; if (!ipcp_type) return -1; @@ -41,10 +42,15 @@ int irm_create_ipcp(rina_name_t name, return -1; msg.code = IRM_CREATE_IPCP; - msg.irm_msg.create_ipcp.name = name; - msg.irm_msg.create_ipcp.ipcp_type = ipcp_type; + msg.msgs.create_ipcp.name = &name; + msg.msgs.create_ipcp.ipcp_type = ipcp_type; + + buf = serialize_irm_msg(&msg); + if (!buf) + return -1; + + write(sockfd, buf->data, buf->size); - write(sockfd, &msg, sizeof(msg)); close(sockfd); return 0; |