Clicker2-STM32 + net/: Add configurations to support the endpoint and hub roles in a star topology. Fix various things that broke when IPv6 forwarding was enabled.

This commit is contained in:
Gregory Nutt
2017-06-29 08:16:46 -06:00
parent a93f130002
commit 6d8df90b79
11 changed files with 3651 additions and 61 deletions
+5 -2
View File
@@ -39,8 +39,13 @@
#include <nuttx/config.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/net/netdev.h>
#include <nuttx/net/netstats.h>
#include "netdev/netdev.h"
#include "sixlowpan/sixlowpan.h"
#include "devif/devif.h"
@@ -85,8 +90,6 @@ static int ipv6_packet_conversion(FAR struct net_driver_s *dev,
#ifdef CONFIG_NET_UDP
if (ipv6->proto == IP_PROTO_UDP)
{
FAR struct ipv6_hdr_s *ipv6 = (FAR struct ipv6_hdr_s *)dev->d_buf;
/* Let 6LoWPAN convert IPv6 UDP output into IEEE802.15.4 frames. */
sixlowpan_udp_send(dev, fwddev, ipv6);
+4 -1
View File
@@ -250,6 +250,9 @@ int ipv6_input(FAR struct net_driver_s *dev)
FAR struct ipv6_hdr_s *ipv6 = IPv6BUF;
uint16_t hdrlen;
uint16_t pktlen;
#ifdef CONFIG_NET_IPFORWARD
int ret;
#endif
/* This is where the input processing starts. */
@@ -350,7 +353,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
#ifdef CONFIG_NET_IPFORWARD
/* Not destined for us, try to forward the packet */
ret = ipv6forward(dev, ipv6);
ret = ipv6_forward(dev, ipv6);
if (ret >= 0)
{
/* The packet was forwarded. Return success; d_len will