From 83edc19882a50d6004d3d9e1485d17d810691010 Mon Sep 17 00:00:00 2001 From: xiehang Date: Mon, 30 Dec 2019 11:23:03 +0800 Subject: [PATCH] ip_frag: Drop IPv4 packets larger than MTU Drop larger packets if ipv4-fragmentation is disabled Ref IDF-4846 --- src/core/ipv4/ip4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c index 0cf58903..ad428e22 100644 --- a/src/core/ipv4/ip4.c +++ b/src/core/ipv4/ip4.c @@ -1030,6 +1030,8 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d if (netif->mtu && (p->tot_len > netif->mtu)) { return ip4_frag(p, netif, dest); } +#else + LWIP_ERROR("ip4_output_if: Packet larger than MTU discarded", !(netif->mtu && p->tot_len > netif->mtu), return ERR_IF;); #endif /* IP_FRAG */ LWIP_DEBUGF(IP_DEBUG, ("ip4_output_if: call netif->output()\n"));