]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/dhcpcd-10.0.2-Allow-free-selection-of-MTU-by-the-user.patch
backup(.pl): Replace OpenVPN DH parameter with ffdhe4096
[people/pmueller/ipfire-2.x.git] / src / patches / dhcpcd-10.0.2-Allow-free-selection-of-MTU-by-the-user.patch
1 From 1acff721a3874a74efc9921a1e07bd48bd7efab0 Mon Sep 17 00:00:00 2001
2 From: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Tue, 22 Feb 2022 12:07:15 +0000
4 Subject: [PATCH] Allow free selection of MTU by the user
5
6 Various ISPs (or equipment?) seem to hand out an MTU of only 576 bytes.
7 Hwoever, this does not seem to be intentional which is why we would like
8 to manually overwrite this in the configuration.
9
10 dhcpcd only allows setting a maximum MTU of 1472 bytes which does not
11 seem to have any rationale (any more). Although Ethernet might limit any
12 MTU to less, IPv6 and IPv4 support MTUs of up to 64KiB.
13
14 This patch allows the user to configure the MTU freely with providing
15 some sanity check.
16
17 Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
18 ---
19 src/dhcp-common.h | 9 +++++----
20 1 file changed, 5 insertions(+), 4 deletions(-)
21
22 diff --git a/src/dhcp-common.h b/src/dhcp-common.h
23 index 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 --
43 2.30.2
44