summaryrefslogtreecommitdiff
path: root/src/ipcpd
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-07-05 16:36:40 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-07-05 16:36:40 +0200
commit51ccc34e0fe15aaf711f30fa8b63de1e1881029f (patch)
tree6c75a9574860e436287c5344ad8364d412c73543 /src/ipcpd
parent627c11526e57b94d466a7d7acd4fe0bf8cd2b776 (diff)
parentdaa4e408b3e34bdc228d26816de09d7d1fb9b043 (diff)
downloadouroboros-51ccc34e0fe15aaf711f30fa8b63de1e1881029f.tar.gz
ouroboros-51ccc34e0fe15aaf711f30fa8b63de1e1881029f.zip
Merged in sandervrijders/ouroboros/be (pull request #154)
lib: Provide first implementation of revised CDAP
Diffstat (limited to 'src/ipcpd')
-rw-r--r--src/ipcpd/ipcp-data.h2
-rw-r--r--src/ipcpd/ipcp.c8
-rw-r--r--src/ipcpd/ipcp.h2
-rw-r--r--src/ipcpd/local/main.c2
-rw-r--r--src/ipcpd/shim-udp/main.c6
5 files changed, 11 insertions, 9 deletions
diff --git a/src/ipcpd/ipcp-data.h b/src/ipcpd/ipcp-data.h
index ce20730b..1e183dca 100644
--- a/src/ipcpd/ipcp-data.h
+++ b/src/ipcpd/ipcp-data.h
@@ -24,7 +24,7 @@
#ifndef IPCPD_IPCP_DATA_H
#define IPCPD_IPCP_DATA_H
-#include <ouroboros/common.h>
+#include <ouroboros/shared.h>
#include <ouroboros/list.h>
#include <sys/types.h>
#include <pthread.h>
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c
index 4acbffa2..579203c2 100644
--- a/src/ipcpd/ipcp.c
+++ b/src/ipcpd/ipcp.c
@@ -236,14 +236,14 @@ void * ipcp_main_loop(void * o)
ipcp_msg__free_unpacked(msg, NULL);
- buffer.size = ipcp_msg__get_packed_size(&ret_msg);
- if (buffer.size == 0) {
+ buffer.len = ipcp_msg__get_packed_size(&ret_msg);
+ if (buffer.len == 0) {
LOG_ERR("Failed to send reply message");
close(lsockfd);
continue;
}
- buffer.data = malloc(buffer.size);
+ buffer.data = malloc(buffer.len);
if (buffer.data == NULL) {
close(lsockfd);
continue;
@@ -251,7 +251,7 @@ void * ipcp_main_loop(void * o)
ipcp_msg__pack(&ret_msg, buffer.data);
- if (write(lsockfd, buffer.data, buffer.size) == -1) {
+ if (write(lsockfd, buffer.data, buffer.len) == -1) {
free(buffer.data);
close(lsockfd);
continue;
diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h
index 1e9e9763..27c3cf8e 100644
--- a/src/ipcpd/ipcp.h
+++ b/src/ipcpd/ipcp.h
@@ -24,6 +24,8 @@
#define IPCPD_IPCP_H
#include <ouroboros/config.h>
+#include <ouroboros/shared.h>
+
#include <pthread.h>
#include "ipcp-ops.h"
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c
index 837cbf8c..4802a161 100644
--- a/src/ipcpd/local/main.c
+++ b/src/ipcpd/local/main.c
@@ -31,7 +31,7 @@
#include <ouroboros/irm_config.h>
#include <ouroboros/sockets.h>
#include <ouroboros/bitmap.h>
-#include <ouroboros/common.h>
+#include <ouroboros/shared.h>
#include <ouroboros/dev.h>
#define OUROBOROS_PREFIX "ipcpd/local"
diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c
index 68d393af..c22947fa 100644
--- a/src/ipcpd/shim-udp/main.c
+++ b/src/ipcpd/shim-udp/main.c
@@ -340,8 +340,8 @@ static int send_shim_udp_msg(shim_udp_msg_t * msg,
r_saddr.sin_addr.s_addr = dst_ip_addr;
r_saddr.sin_port = LISTEN_PORT;
- buf.size = shim_udp_msg__get_packed_size(msg);
- if (buf.size == 0) {
+ buf.len = shim_udp_msg__get_packed_size(msg);
+ if (buf.len == 0) {
return -1;
}
@@ -354,7 +354,7 @@ static int send_shim_udp_msg(shim_udp_msg_t * msg,
if (sendto(shim_data(_ipcp)->s_fd,
buf.data,
- buf.size,
+ buf.len,
0,
(struct sockaddr *) &r_saddr,
sizeof(r_saddr)) == -1) {