net/Kconfig: Ethernet packet buffer size cannot be permitted to go below 1294 is IPv6 is selected.

This commit is contained in:
Gregory Nutt 2019-08-31 09:08:32 -06:00
parent 89096d0fc7
commit 9bdde04636
3 changed files with 6 additions and 2 deletions

View File

@ -85,7 +85,7 @@
/* IP Header sizes */
#ifdef CONFIG_NET_IPv4
# define IPv4_HDRLEN 20 /* Size of IPv4 header */
# define IPv4_HDRLEN 20 /* Size of IPv4 header (without options) */
#endif
#ifdef CONFIG_NET_IPv6

View File

@ -45,8 +45,9 @@ config NET_ETH_PKTSIZE
int "Ethernet packet buffer size"
default 1294 if NET_IPv6
default 590 if !NET_IPv6
range 1294 1518 if NET_IPv6
range 590 1518 if !NET_IPv6
depends on NET_ETHERNET
range 590 1518
---help---
Packet buffer size. This size includes the TCP/UDP payload plus the
size of TCP/UDP header, the IP header, and the Ethernet header.

View File

@ -344,6 +344,9 @@ int ipv4_input(FAR struct net_driver_s *dev)
/* Start of IP input header processing code.
*
* Check validity of the IP header.
* REVISIT: Does not account for varying IP header length due to the
* presences of IPv4 options. The header length is encoded as a number
* 32-bit words in the HL nibble of the VHL.
*/
if (ipv4->vhl != 0x45)