From 642e3469d7265431a21f433f8c8d10d1f30cbe6c Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 31 Mar 2018 12:48:26 +0200 Subject: ipcpd: Fix frame buffer in eth ipcps The packets were being sent and read into a buffer that had the payload length instead of the frame length. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/eth/eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index 90143d2f..b43caae1 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -351,7 +351,7 @@ static int eth_ipcp_send_frame(const uint8_t * dst_addr, #ifdef BUILD_ETH_LLC uint8_t cf = 0x03; #endif - uint8_t frame[ETH_MAX_SDU_SIZE]; + uint8_t frame[ETH_FRAME_SIZE]; struct eth_frame * e_frame; assert(payload); @@ -795,7 +795,7 @@ static void * eth_ipcp_sdu_reader(void * o) frame_len = read(eth_data.bpf, buf, BPF_BLEN); #elif defined(HAVE_RAW_SOCKETS) frame_len = recv(eth_data.s_fd, buf, - ETH_MAX_SDU_SIZE, 0); + ETH_FRAME_SIZE, 0); #endif if (frame_len <= 0) continue; -- cgit v1.2.3