mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 04:52:02 +08:00
net/ipv6: Drop IP packet shorter than length in IP header
If the length of received ip packet is shorter than length in ip header, drop it. Signed-off-by: wenquan1 <wenquan1@xiaomi.com>
This commit is contained in:
@@ -224,6 +224,8 @@ static int ipv6_in(FAR struct net_driver_s *dev)
|
||||
|
||||
/* Get the size of the packet minus the size of link layer header */
|
||||
|
||||
dev->d_len -= NET_LL_HDRLEN(dev);
|
||||
|
||||
if (IPv6_HDRLEN > dev->d_len)
|
||||
{
|
||||
nwarn("WARNING: Packet shorter than IPv6 header\n");
|
||||
|
||||
Reference in New Issue
Block a user