]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/blame - src/patches/dhcpcd-9.4.0-Allow-free-selection-of-MTU-by-the-user.patch
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-2.x
[people/mfischer/ipfire-2.x.git] / src / patches / dhcpcd-9.4.0-Allow-free-selection-of-MTU-by-the-user.patch
CommitLineData
7cdd5505
MT
1From 1acff721a3874a74efc9921a1e07bd48bd7efab0 Mon Sep 17 00:00:00 2001
2From: Michael Tremer <michael.tremer@ipfire.org>
3Date: Tue, 22 Feb 2022 12:07:15 +0000
4Subject: [PATCH] Allow free selection of MTU by the user
5
6Various ISPs (or equipment?) seem to hand out an MTU of only 576 bytes.
7Hwoever, this does not seem to be intentional which is why we would like
8to manually overwrite this in the configuration.
9
10dhcpcd only allows setting a maximum MTU of 1472 bytes which does not
11seem to have any rationale (any more). Although Ethernet might limit any
12MTU to less, IPv6 and IPv4 support MTUs of up to 64KiB.
13
14This patch allows the user to configure the MTU freely with providing
15some sanity check.
16
17Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
18---
19 src/dhcp-common.h | 9 +++++----
20 1 file changed, 5 insertions(+), 4 deletions(-)
21
22diff --git a/src/dhcp-common.h b/src/dhcp-common.h
23index a82fcd4c..d6620822 100644
24--- a/src/dhcp-common.h
25+++ b/src/dhcp-common.h
26@@ -46,10 +46,11 @@
27 #define NS_MAXLABEL MAXLABEL
28 #endif
29
30-/* Max MTU - defines dhcp option length */
31-#define IP_UDP_SIZE 28
32-#define MTU_MAX 1500 - IP_UDP_SIZE
33-#define MTU_MIN 576 + IP_UDP_SIZE
34+/* Max/Min MTU */
35+#define MTU_MAX 65536
36+#define MTU_MIN 576
37+
38+#define IP_UDP_SIZE 28
39
40 #define OT_REQUEST (1 << 0)
41 #define OT_UINT8 (1 << 1)
42--
432.30.2
44