mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Fixes for networking and tiny webserver from Max
This commit is contained in:
@@ -60,10 +60,12 @@
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/net/arp.h>
|
||||
#include <nuttx/net/netdev.h>
|
||||
#include <nuttx/net/tcp.h>
|
||||
|
||||
#include "socket/socket.h"
|
||||
#include "netdev/netdev.h"
|
||||
#include "devif/devif.h"
|
||||
#include "tcp/tcp.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
|
||||
@@ -126,6 +126,13 @@ static uint16_t upper_layer_chksum(FAR struct net_driver_s *dev, uint8_t proto)
|
||||
upper_layer_len = (((uint16_t)(pbuf->len[0]) << 8) + pbuf->len[1]) - UIP_IPH_LEN;
|
||||
#endif /* CONFIG_NET_IPv6 */
|
||||
|
||||
/* Verify some minimal assumptions */
|
||||
|
||||
if (upper_layer_len > CONFIG_NET_BUFSIZE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* First sum pseudo-header. */
|
||||
|
||||
/* IP protocol and length fields. This addition cannot carry. */
|
||||
|
||||
Reference in New Issue
Block a user