mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
net/: add NET_ICMP[v6]_NO_STACK for usrsock case
This commit is contained in:
@@ -548,7 +548,7 @@ int ipv4_input(FAR struct net_driver_s *dev)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ICMP
|
#ifdef NET_ICMP_HAVE_STACK
|
||||||
/* Check for ICMP input */
|
/* Check for ICMP input */
|
||||||
|
|
||||||
case IP_PROTO_ICMP: /* ICMP input */
|
case IP_PROTO_ICMP: /* ICMP input */
|
||||||
|
|||||||
@@ -512,9 +512,9 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ICMPv6
|
|
||||||
/* Check for ICMP input */
|
/* Check for ICMP input */
|
||||||
|
|
||||||
|
#ifdef NET_ICMPv6_HAVE_STACK
|
||||||
case IP_PROTO_ICMP6: /* ICMP6 input */
|
case IP_PROTO_ICMP6: /* ICMP6 input */
|
||||||
/* Forward the ICMPv6 packet */
|
/* Forward the ICMPv6 packet */
|
||||||
|
|
||||||
@@ -546,7 +546,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_NET_6LOWPAN */
|
#endif /* CONFIG_NET_6LOWPAN */
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_NET_ICMPv6 */
|
#endif /* NET_ICMPv6_HAVE_STACK */
|
||||||
|
|
||||||
default: /* Unrecognized/unsupported protocol */
|
default: /* Unrecognized/unsupported protocol */
|
||||||
nwarn("WARNING: Unrecognized IP protocol: %04x\n", ipv6->proto);
|
nwarn("WARNING: Unrecognized IP protocol: %04x\n", ipv6->proto);
|
||||||
|
|||||||
+9
-2
@@ -13,7 +13,14 @@ config NET_ICMP
|
|||||||
Enable minimal ICMP support. Includes built-in support
|
Enable minimal ICMP support. Includes built-in support
|
||||||
for sending replies to received ECHO (ping) requests.
|
for sending replies to received ECHO (ping) requests.
|
||||||
|
|
||||||
if NET_ICMP
|
config NET_ICMP_NO_STACK
|
||||||
|
bool "Disable ICMP stack"
|
||||||
|
default n
|
||||||
|
select NET_ICMP
|
||||||
|
---help---
|
||||||
|
Build without ICMP stack even if ICMP networking support enabled.
|
||||||
|
|
||||||
|
if NET_ICMP && !NET_ICMP_NO_STACK
|
||||||
|
|
||||||
config NET_ICMP_SOCKET
|
config NET_ICMP_SOCKET
|
||||||
bool "IPPROTO_ICMP socket support"
|
bool "IPPROTO_ICMP socket support"
|
||||||
@@ -31,6 +38,6 @@ config NET_ICMP_NCONNS
|
|||||||
depends on MM_IOB
|
depends on MM_IOB
|
||||||
|
|
||||||
endif # NET_ICMP_SOCKET
|
endif # NET_ICMP_SOCKET
|
||||||
endif # NET_ICMP
|
endif # NET_ICMP && !NET_ICMP_NO_STACK
|
||||||
endmenu # ICMP Networking Support
|
endmenu # ICMP Networking Support
|
||||||
endif # NET_IPv4
|
endif # NET_IPv4
|
||||||
|
|||||||
+4
-1
@@ -34,6 +34,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
ifeq ($(CONFIG_NET_ICMP),y)
|
ifeq ($(CONFIG_NET_ICMP),y)
|
||||||
|
ifneq ($(CONFIG_NET_ICMP_NO_STACK),y)
|
||||||
|
|
||||||
# ICMP source files
|
# ICMP source files
|
||||||
|
|
||||||
@@ -51,4 +52,6 @@ endif
|
|||||||
|
|
||||||
DEPPATH += --dep-path icmp
|
DEPPATH += --dep-path icmp
|
||||||
VPATH += :icmp
|
VPATH += :icmp
|
||||||
endif
|
|
||||||
|
endif # !CONFIG_NET_ICMP_NO_STACK
|
||||||
|
endif # CONFIG_NET_ICMP
|
||||||
|
|||||||
+4
-2
@@ -51,12 +51,14 @@
|
|||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ICMP
|
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#define NET_ICMP_HAVE_STACK 1
|
||||||
|
|
||||||
/* Allocate/free an ICMP data callback */
|
/* Allocate/free an ICMP data callback */
|
||||||
|
|
||||||
#define icmp_callback_alloc(dev) devif_callback_alloc(dev, &(dev)->d_conncb)
|
#define icmp_callback_alloc(dev) devif_callback_alloc(dev, &(dev)->d_conncb)
|
||||||
@@ -360,5 +362,5 @@ int icmp_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_NET_ICMP */
|
#endif /* CONFIG_NET_ICMP && !CONFIG_NET_ICMP_NO_STACK */
|
||||||
#endif /* __NET_ICMP_ICMP_H */
|
#endif /* __NET_ICMP_ICMP_H */
|
||||||
|
|||||||
+9
-2
@@ -14,7 +14,14 @@ config NET_ICMPv6
|
|||||||
Enable minimal ICMPv6 support. Includes built-in support
|
Enable minimal ICMPv6 support. Includes built-in support
|
||||||
for sending replies to received ECHO (ping) requests.
|
for sending replies to received ECHO (ping) requests.
|
||||||
|
|
||||||
if NET_ICMPv6
|
config NET_ICMPv6_NO_STACK
|
||||||
|
bool "Disable ICMPv6 stack"
|
||||||
|
default n
|
||||||
|
select NET_ICMPv6
|
||||||
|
---help---
|
||||||
|
Build without ICMPv6 stack even if ICMPv6 networking support enabled.
|
||||||
|
|
||||||
|
if NET_ICMPv6 && !NET_ICMPv6_NO_STACK
|
||||||
|
|
||||||
config NET_ICMPv6_SOCKET
|
config NET_ICMPv6_SOCKET
|
||||||
bool "IPPROTO_ICMP6 socket support"
|
bool "IPPROTO_ICMP6 socket support"
|
||||||
@@ -200,6 +207,6 @@ config NET_ICMPv6_NCONNS
|
|||||||
|
|
||||||
endif # NET_ICMPv6_SOCKET
|
endif # NET_ICMPv6_SOCKET
|
||||||
|
|
||||||
endif # NET_ICMPv6
|
endif # NET_ICMPv6 && !NET_ICMPv6_NO_STACK
|
||||||
endmenu # ICMPv6 Networking Support
|
endmenu # ICMPv6 Networking Support
|
||||||
endif # NET_IPv6
|
endif # NET_IPv6
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
ifeq ($(CONFIG_NET_ICMPv6),y)
|
ifeq ($(CONFIG_NET_ICMPv6),y)
|
||||||
|
ifneq ($(CONFIG_NET_ICMPv6_NO_STACK),y)
|
||||||
|
|
||||||
# ICMPv6 source files
|
# ICMPv6 source files
|
||||||
|
|
||||||
@@ -70,4 +71,5 @@ endif
|
|||||||
DEPPATH += --dep-path icmpv6
|
DEPPATH += --dep-path icmpv6
|
||||||
VPATH += :icmpv6
|
VPATH += :icmpv6
|
||||||
|
|
||||||
endif
|
endif # !CONFIG_NET_ICMPv6_NO_STACK
|
||||||
|
endif # CONFIG_NET_ICMPv6
|
||||||
+5
-2
@@ -52,12 +52,14 @@
|
|||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ICMPv6
|
#if defined(CONFIG_NET_ICMPv6) && !defined(CONFIG_NET_ICMPv6_NO_STACK)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#define NET_ICMPv6_HAVE_STACK 1
|
||||||
|
|
||||||
/* Allocate a new ICMPv6 data callback */
|
/* Allocate a new ICMPv6 data callback */
|
||||||
|
|
||||||
#define icmpv6_callback_alloc(dev) \
|
#define icmpv6_callback_alloc(dev) \
|
||||||
@@ -706,5 +708,6 @@ int icmpv6_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_NET_ICMPv6 */
|
#endif /* CONFIG_NET_ICMPv6 && !CONFIG_NET_ICMPv6_NO_STACK */
|
||||||
#endif /* __NET_ICMPv6_ICMPv6_H */
|
#endif /* __NET_ICMPv6_ICMPv6_H */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user