Commit fe56ce5a authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Mahesh Mahadevan
Browse files

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: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
parent 41431637
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -818,15 +818,7 @@ enum net_verdict net_ipv6_prepare_for_send(struct net_pkt *pkt)
							   pkt, pkt_len);
			if (ret < 0) {
				NET_DBG("Cannot fragment IPv6 pkt (%d)", ret);

				if (ret == -ENOMEM) {
					/* Try to send the packet if we could
					 * not allocate enough network packets
					 * and hope the original large packet
					 * can be sent ok.
					 */
					goto ignore_frag_error;
				}
				return NET_DROP;
			}

			/* 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)
			return NET_CONTINUE;
		}
	}
ignore_frag_error:
#endif /* CONFIG_NET_IPV6_FRAGMENT */

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