Skip to content

Commit 1d62d83

Browse files
pdgendtkartben
authored andcommitted
net: ip: Configurable IPv4 MTU
Allow to configure the initial IPv4 MTU needed to support packets without fragmentation. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent a853460 commit 1d62d83

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/zephyr/net/net_ip.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,11 @@ enum net_ip_mtu {
496496
/** IPv4 MTU length. We must be able to receive this size IPv4 packet
497497
* without fragmentation.
498498
*/
499+
#if defined(CONFIG_NET_NATIVE_IPV4)
500+
NET_IPV4_MTU = CONFIG_NET_IPV4_MTU,
501+
#else
499502
NET_IPV4_MTU = 576,
503+
#endif
500504
};
501505

502506
/** @brief Network packet priority settings described in IEEE 802.1Q Annex I.1 */

subsys/net/ip/Kconfig.ipv4

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ config NET_IPV4_DEFAULT_NETMASK
4242

4343
if NET_NATIVE_IPV4
4444

45+
config NET_IPV4_MTU
46+
int "Initial IPv4 MTU value"
47+
default 576
48+
range 576 1500
49+
help
50+
The value should normally be 576 which is the minimum IPv4 packet
51+
size that implementations need to support without fragmentation.
52+
4553
config NET_INITIAL_TTL
4654
int "Initial IPv4 time to live value for unicast packets"
4755
default 64

0 commit comments

Comments
 (0)