From 42a92c75ea85760b145e1531482e9b2b8cea48fe Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 8 May 2018 11:56:24 +0200 Subject: ipcpd: Fix setting MTU for eth-llc The MTU was not correctly set for the eth-llc ipcp. This also fixes a missing definition of ETH_MAX_MTU, which was introduced in kernel v4.10. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/eth/eth.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index 77a919ef..90a7b0fd 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -94,13 +94,22 @@ #endif #define MAC_SIZE 6 -#if defined(__linux__) && defined(BUILD_ETH_DIX) +#ifdef __linux__ +#ifndef ETH_MAX_MTU /* In if_ether.h as of Linux 4.10. */ +#define ETH_MAX_MTU 65535 +#endif /* ETH_MAX_MTU */ +#ifdef BUILD_ETH_DIX #define ETH_MTU eth_data.mtu -#define ETH_MTU_MAX ETH_MAX_MTU /* if_ether.h */ +#define ETH_MTU_MAX ETH_MAX_MTU #else +#define ETH_MTU eth_data.mtu +#define ETH_MTU_MAX 1500 +#endif /* BUILD_ETH_DIX */ +#else /* __linux__ */ #define ETH_MTU 1500 #define ETH_MTU_MAX ETH_MTU -#endif +#endif /* __linux__ */ + #define ETH_TYPE_LENGTH_SIZE sizeof(uint16_t) #define ETH_HEADER_SIZE (2 * MAC_SIZE + ETH_TYPE_LENGTH_SIZE) -- cgit v1.2.3