net/ethernet: fix compilation issues

fix compilation issues

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
This commit is contained in:
gaohedong 2025-05-28 22:20:01 +08:00 committed by Xiang Xiao
parent c0fa2cae3d
commit ea31ceac23
2 changed files with 5 additions and 0 deletions

View file

@ -721,12 +721,14 @@ static int inet_get_socketlevel_option(FAR struct socket *psock, int option,
return -EINVAL;
}
# ifdef NET_UDP_HAVE_STACK
if (psock->s_type == SOCK_DGRAM)
{
FAR struct udp_conn_s *conn = psock->s_conn;
*(FAR int *)value = (conn->timestamp != 0);
}
else
# endif
{
return -ENOPROTOOPT;
}
@ -1023,6 +1025,7 @@ static int inet_set_socketlevel_option(FAR struct socket *psock, int option,
return -EINVAL;
}
# ifdef NET_UDP_HAVE_STACK
if (psock->s_type == SOCK_DGRAM)
{
conn_lock(psock->s_conn);
@ -1038,6 +1041,7 @@ static int inet_set_socketlevel_option(FAR struct socket *psock, int option,
conn_unlock(psock->s_conn);
}
else
# endif
{
return -ENOPROTOOPT;
}

View file

@ -9,6 +9,7 @@ config NET_PKT
bool "Socket packet socket support"
default n
select NETDEV_IFINDEX
select NET_READAHEAD
---help---
Enable or disable support for packet sockets.