summaryrefslogtreecommitdiff
path: root/src/ipcpd
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-05-08 11:56:24 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-05-08 12:04:58 +0200
commit42a92c75ea85760b145e1531482e9b2b8cea48fe (patch)
tree493b120668249b4380c0f9c2b7714f700b5f6b93 /src/ipcpd
parent80c796f5250f8158ec922bdcf2a48dd33717fd60 (diff)
downloadouroboros-42a92c75ea85760b145e1531482e9b2b8cea48fe.tar.gz
ouroboros-42a92c75ea85760b145e1531482e9b2b8cea48fe.zip
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 <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/ipcpd')
-rw-r--r--src/ipcpd/eth/eth.c15
1 files 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)