mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
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:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user