lwip: Drop packets larger than MTU

This commit is contained in:
xiehang
2020-01-10 19:19:11 +08:00
parent 30fc65fcff
commit 20871acb55
2 changed files with 3 additions and 1 deletions

View File

@ -85,7 +85,7 @@ config LWIP_DHCP_MAX_NTP_SERVERS
config LWIP_IP_FRAG
bool "Enable fragment outgoing IP packets"
default n
default y
help
Enabling this option allows fragmenting outgoing IP packets if their size
exceeds MTU.

View File

@ -980,6 +980,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: Packets 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"));