diff --git a/include/nuttx/net/ip.h b/include/nuttx/net/ip.h index bdacec48ea8..942e4d946a1 100644 --- a/include/nuttx/net/ip.h +++ b/include/nuttx/net/ip.h @@ -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 diff --git a/net/Kconfig b/net/Kconfig index 077e120b272..d10088697f9 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -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. diff --git a/net/devif/ipv4_input.c b/net/devif/ipv4_input.c index d693e2c15a3..c012337d34f 100644 --- a/net/devif/ipv4_input.c +++ b/net/devif/ipv4_input.c @@ -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)