icmp/icmpv6: fix the level parameter type

use a more standard definition

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2025-02-21 15:34:50 +08:00
committed by Xiang Xiao
parent d697f1c4f6
commit f7526522a1
3 changed files with 14 additions and 12 deletions

View File

@@ -230,10 +230,12 @@
/* Protocol-level socket operations. */
#define SOL_IP IPPROTO_IP /* See options in include/netinet/ip.h */
#define SOL_IPV6 IPPROTO_IPV6 /* See options in include/netinet/ip6.h */
#define SOL_TCP IPPROTO_TCP /* See options in include/netinet/tcp.h */
#define SOL_UDP IPPROTO_UDP /* See options in include/netinit/udp.h */
#define SOL_IP IPPROTO_IP /* See options in include/netinet/in.h */
#define SOL_IPV6 IPPROTO_IPV6 /* See options in include/netinet/in.h */
#define SOL_TCP IPPROTO_TCP /* See options in include/netinet/in.h */
#define SOL_UDP IPPROTO_UDP /* See options in include/netinet/in.h */
#define SOL_RAW IPPROTO_RAW /* See options in include/netinet/in.h */
#define SOL_ICMPV6 IPPROTO_ICMPV6 /* See options in include/netinet/in.h */
/* Bluetooth-level operations. */

View File

@@ -383,10 +383,10 @@ static int icmp_getsockopt(FAR struct socket *psock, int level, int option,
{
switch (level)
{
case IPPROTO_IP:
case SOL_IP:
return ipv4_getsockopt(psock, option, value, value_len);
case IPPROTO_ICMP:
case SOL_RAW:
return icmp_getsockopt_internal(psock, option, value, value_len);
default:
@@ -486,10 +486,10 @@ static int icmp_setsockopt(FAR struct socket *psock, int level, int option,
{
switch (level)
{
case IPPROTO_IP:
case SOL_IP:
return ipv4_setsockopt(psock, option, value, value_len);
case IPPROTO_ICMP:
case SOL_RAW:
return icmp_setsockopt_internal(psock, option, value, value_len);
default:

View File

@@ -381,10 +381,10 @@ static int icmpv6_getsockopt(FAR struct socket *psock, int level, int option,
{
switch (level)
{
case IPPROTO_IPV6:
case SOL_IPV6:
return ipv6_getsockopt(psock, option, value, value_len);
case IPPROTO_ICMPV6:
case SOL_ICMPV6:
return icmpv6_getsockopt_internal(psock, option, value, value_len);
default:
@@ -484,10 +484,10 @@ static int icmpv6_setsockopt(FAR struct socket *psock, int level, int option,
{
switch (level)
{
case IPPROTO_IPV6:
case SOL_IPV6:
return ipv6_setsockopt(psock, option, value, value_len);
case IPPROTO_ICMPV6:
case SOL_ICMPV6:
return icmpv6_setsockopt_internal(psock, option, value, value_len);
default: