summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/interpreters/README.txt7
-rw-r--r--nuttx/net/devif/ipv6_input.c18
-rw-r--r--nuttx/net/udp/udp_send.c4
3 files changed, 21 insertions, 8 deletions
diff --git a/apps/interpreters/README.txt b/apps/interpreters/README.txt
index c51f48eff..f3ba029b0 100644
--- a/apps/interpreters/README.txt
+++ b/apps/interpreters/README.txt
@@ -98,10 +98,15 @@ micropython
error: unknown type name 'wint_t'
You can't include the NuttX wchar.h header file where this is defined, but
- you can add this to the mpconfigport.h header file:
+ you can add this to the mpconfigport.h header file (if it is not already
+ there):
typedef int wint_t;
+ Is the missing wint_t definition coming from alloca.h? You can either
+ (1) replace alloc(a) with the #define described above, or (2) move the
+ typedef of wint_t to before the inclusion of alloca.h.
+
6. Micro Python is released under the MIT license which is license-compatible
with the NuttX 3-clause BSD license. Here is the full text of the Micro
Python LICENSE file as of 2015-01-14:
diff --git a/nuttx/net/devif/ipv6_input.c b/nuttx/net/devif/ipv6_input.c
index 3f71a0ee3..d50838902 100644
--- a/nuttx/net/devif/ipv6_input.c
+++ b/nuttx/net/devif/ipv6_input.c
@@ -140,7 +140,7 @@
int ipv6_input(FAR struct net_driver_s *dev)
{
FAR struct ipv6_hdr_s *ipv6 = IPv6BUF;
- uint16_t iplen;
+ uint16_t pktlen;
/* This is where the input processing starts. */
@@ -172,13 +172,21 @@ int ipv6_input(FAR struct net_driver_s *dev)
*
* The length reported in the IPv6 header is the length of the payload
* that follows the header. The device interface uses the d_len variable for
- * holding the size of the entire packet, including the IP header.
+ * holding the size of the entire packet, including the IP and link layer
+ * headers.
*/
- iplen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN + ETH_HDRLEN;
- if (iplen <= dev->d_len)
+#if defined(CONFIG_NET_MULTILINK)
+ pktlen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN + dev->d_llhdrlen;
+#elif defined(CONFIG_NET_ETHERNET)
+ pktlen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN + ETH_HDRLEN;
+#else /* if defined(CONFIG_NET_SLIP) */
+ pktlen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN;
+#endif
+
+ if (pktlen <= dev->d_len)
{
- dev->d_len = iplen;
+ dev->d_len = pktlen;
}
else
{
diff --git a/nuttx/net/udp/udp_send.c b/nuttx/net/udp/udp_send.c
index 27d5ff1c9..b6ef3bd76 100644
--- a/nuttx/net/udp/udp_send.c
+++ b/nuttx/net/udp/udp_send.c
@@ -212,8 +212,8 @@ void udp_send(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn)
/* Calculate UDP checksum. */
#ifdef CONFIG_NET_IPv4
-#ifdef CONFIG_NET_IPv5
- if (conn->domain = PF_INET)
+#ifdef CONFIG_NET_IPv6
+ if (conn->domain == PF_INET)
#endif
{
udp->udpchksum = ~udp_ipv4_chksum(dev);