summaryrefslogtreecommitdiff
path: root/ecp/server
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2024-05-10 21:54:45 +0200
committerUros Majstorovic <majstor@majstor.org>2024-05-10 21:54:45 +0200
commitdcc5330eefd12028b64acb03c832f5ff4764b7a8 (patch)
tree317f14689c2596b1543615291e5e3aad89715844 /ecp/server
parentce55165b6952f9325c34b0008b5116b16736c4cb (diff)
PKT_BUF and PLD_BUF macros fixed
Diffstat (limited to 'ecp/server')
-rw-r--r--ecp/server/Makefile2
-rw-r--r--ecp/server/dir.c4
-rw-r--r--ecp/server/dir.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/ecp/server/Makefile b/ecp/server/Makefile
index 1ac945d..977e891 100644
--- a/ecp/server/Makefile
+++ b/ecp/server/Makefile
@@ -3,7 +3,7 @@ include $(src_dir)/ecp/common.mk
CFLAGS += -I../util -Wno-int-to-void-pointer-cast
LDFLAGS += -lrt
-obj = server.o dir.o vlink.o ht.o acl.o sig.o # timer.o
+obj = server.o dir.o vlink.o ht.o acl.o sig.o timer.o
dep = ../build-posix/*.a ../util/libecputil.a
%.o: %.c
diff --git a/ecp/server/dir.c b/ecp/server/dir.c
index 738c787..03474df 100644
--- a/ecp/server/dir.c
+++ b/ecp/server/dir.c
@@ -112,8 +112,8 @@ ssize_t dir_handle_client_msg(struct ECPConnection *conn, ecp_seq_t seq, unsigne
ssize_t dir_send_ann(ECPConnection *conn) {
ECPBuffer packet;
ECPBuffer payload;
- unsigned char pkt_buf[ECP_SIZE_PKT_BUF(2, MTYPE_DIR_ANN, conn)];
- unsigned char pld_buf[ECP_SIZE_PLD_BUF(2, MTYPE_DIR_ANN, conn)];
+ unsigned char pkt_buf[ECP_SIZE_PKT_BUF(ECP_SIZE_PLD(2, MTYPE_DIR_ANN), conn)];
+ unsigned char pld_buf[ECP_SIZE_PLD_BUF(ECP_SIZE_PLD(2, MTYPE_DIR_ANN), conn)];
unsigned char *msg;
packet.buffer = pkt_buf;
diff --git a/ecp/server/dir.h b/ecp/server/dir.h
index 0871c33..022010a 100644
--- a/ecp/server/dir.h
+++ b/ecp/server/dir.h
@@ -1,4 +1,4 @@
-#define MAX_DIR_ITEM_IN_MSG ((ECP_MAX_PLD - ECP_SIZE_PLD(0, ECP_MTYPE_DIR_REP) - (2 + sizeof(uint16_t))) / ECP_SIZE_DIR_ITEM)
+#define MAX_DIR_ITEM_IN_MSG ((ECP_MAX_PLD - ECP_SIZE_PLD((2 + sizeof(uint16_t)), ECP_MTYPE_DIR_REP)) / ECP_SIZE_DIR_ITEM)
#define MAX_DIR_MSG 10
#define MAX_DIR_ITEM (MAX_DIR_MSG * MAX_DIR_ITEM_IN_MSG)