mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
Remove CONFIG_NETDEV_MULTINIC. This increases code size by a little, but greatly reduces the complexity of the network code.
This commit is contained in:
@@ -50,10 +50,8 @@ endif
|
||||
# IP forwarding
|
||||
|
||||
ifeq ($(CONFIG_NET_IPFORWARD),y)
|
||||
ifeq ($(CONFIG_NETDEV_MULTINIC),y)
|
||||
NET_CSRCS += devif_forward.c
|
||||
endif
|
||||
endif
|
||||
|
||||
# I/O buffer chain support required?
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "ipforward/ipforward.h"
|
||||
#include "devif/devif.h"
|
||||
|
||||
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC)
|
||||
#ifdef CONFIG_NET_IPFORWARD
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -92,4 +92,4 @@ void devif_forward(FAR struct forward_s *fwd)
|
||||
fwd->f_dev->d_len = offset;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET_IPFORWARD && CONFIG_NETDEV_MULTINIC */
|
||||
#endif /* CONFIG_NET_IPFORWARD */
|
||||
|
||||
@@ -299,7 +299,7 @@ static inline int devif_poll_icmpv6(FAR struct net_driver_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC)
|
||||
#ifdef CONFIG_NET_IPFORWARD
|
||||
static inline int devif_poll_forward(FAR struct net_driver_s *dev,
|
||||
devif_poll_callback_t callback)
|
||||
{
|
||||
@@ -575,7 +575,7 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
|
||||
|
||||
if (!bstop)
|
||||
#endif
|
||||
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC)
|
||||
#ifdef CONFIG_NET_IPFORWARD
|
||||
{
|
||||
/* Traverse all of the tasks waiting to forward a packet to this device. */
|
||||
|
||||
|
||||
@@ -128,7 +128,6 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_MULTINIC
|
||||
static int check_dev_destipaddr(FAR struct net_driver_s *dev, FAR void *arg)
|
||||
{
|
||||
FAR struct ipv6_hdr_s *ipv6 = (FAR struct ipv6_hdr_s *)arg;
|
||||
@@ -146,7 +145,6 @@ static int check_dev_destipaddr(FAR struct net_driver_s *dev, FAR void *arg)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: check_destipaddr
|
||||
@@ -171,9 +169,7 @@ static int check_dev_destipaddr(FAR struct net_driver_s *dev, FAR void *arg)
|
||||
static bool check_destipaddr(FAR struct net_driver_s *dev,
|
||||
FAR struct ipv6_hdr_s *ipv6)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_MULTINIC
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
/* For IPv6, packet reception is a little trickier as we need to make sure
|
||||
* that we listen to certain multicast addresses (all hosts multicast
|
||||
@@ -192,7 +188,6 @@ static bool check_destipaddr(FAR struct net_driver_s *dev,
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NETDEV_MULTINIC
|
||||
/* We will also allow for a perverse case where we receive a packet
|
||||
* addressed to us, but on a different device. Can that really happen?
|
||||
*/
|
||||
@@ -207,17 +202,6 @@ static bool check_destipaddr(FAR struct net_driver_s *dev,
|
||||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
/* There is only one network device. If this packet is addressed to us,
|
||||
* then the IPv6 destination address must be the address of assigned to
|
||||
* this device.
|
||||
*/
|
||||
|
||||
if (net_ipv6addr_cmp(ipv6->destipaddr, dev->d_ipv6addr))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user