Skip to content

Commit fe56ce5

Browse files
jukkarmmahadevan108
authored andcommitted
net: ipv6: fragmentation: Drop the packet if fragmentation fails
If we could not fragment the IPv6 packet, then drop it and do not try to send it. Let the upper layer re-send the packet if needed. It is causing more trouble if we try to send the packet and not honor the MTU setting. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 4143163 commit fe56ce5

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

subsys/net/ip/ipv6_nbr.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -818,15 +818,7 @@ enum net_verdict net_ipv6_prepare_for_send(struct net_pkt *pkt)
818818
pkt, pkt_len);
819819
if (ret < 0) {
820820
NET_DBG("Cannot fragment IPv6 pkt (%d)", ret);
821-
822-
if (ret == -ENOMEM) {
823-
/* Try to send the packet if we could
824-
* not allocate enough network packets
825-
* and hope the original large packet
826-
* can be sent ok.
827-
*/
828-
goto ignore_frag_error;
829-
}
821+
return NET_DROP;
830822
}
831823

832824
/* We need to unref here because we simulate the packet
@@ -841,7 +833,6 @@ enum net_verdict net_ipv6_prepare_for_send(struct net_pkt *pkt)
841833
return NET_CONTINUE;
842834
}
843835
}
844-
ignore_frag_error:
845836
#endif /* CONFIG_NET_IPV6_FRAGMENT */
846837

847838
/* If the IPv6 destination address is not link local, then try to get

0 commit comments

Comments
 (0)