Skip to content
Permalink
Browse files

net: pkt: Allow larger packets for IPv6 fragmentation

If the allocated net_pkt is larger than the network interface MTU,
then check if the IPv6 fragmentation is enabled and allow larger
net_pkt length as the IPv6 fragmentation will split the packet into
suitable parts.

Fixes #16354

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed Jul 22, 2019
1 parent ccba103 commit aaafb6abba208f04b589cf1163a9a5948e36d2fe
Showing with 7 additions and 0 deletions.
  1. +7 −0 subsys/net/ip/net_pkt.c
@@ -954,6 +954,13 @@ static size_t pkt_buffer_length(struct net_pkt *pkt,

/* Family vs iface MTU */
if (IS_ENABLED(CONFIG_NET_IPV6) && family == AF_INET6) {
if (IS_ENABLED(CONFIG_NET_IPV6_FRAGMENT) && (size > max_len)) {
/* We support larger packets if IPv6 fragmentation is
* enabled.
*/
max_len = size;
}

max_len = MAX(max_len, NET_IPV6_MTU);
} else if (IS_ENABLED(CONFIG_NET_IPV4) && family == AF_INET) {
max_len = MAX(max_len, NET_IPV4_MTU);

0 comments on commit aaafb6a

Please sign in to comment.
You can’t perform that action at this time.