ip_frag: Drop IPv4 packets larger than MTU

Drop larger packets if ipv4-fragmentation is disabled

Ref IDF-4846
This commit is contained in:
xiehang
2019-12-30 11:23:03 +08:00
committed by David Cermak
parent 8cf7089c58
commit 83edc19882
+2
View File
@@ -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"));