mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 01:39:44 +08:00
add UDP compile option to avoid build error
The following build error happens when CONFIG_NET_IPv6 is enabled and CONFIG_NET_UDP is not enabled.
inet/ipv6_setsockopt.c:132:19: error: invalid use of undefined type 'struct udp_conn_s'
132 | conn->flags |= _UDP_FLAG_PKTINFO;
| ^~
inet/ipv6_setsockopt.c:132:30: error: '_UDP_FLAG_PKTINFO' undeclared (first use in this function)
132 | conn->flags |= _UDP_FLAG_PKTINFO;
| ^~~~~~~~~~~~~~~~~
inet/ipv6_setsockopt.c:132:30: note: each undeclared identifier is reported only once for each function it appears in
inet/ipv6_setsockopt.c:136:19: error: invalid use of undefined type 'struct udp_conn_s'
136 | conn->flags &= ~_UDP_FLAG_PKTINFO;
Signed-off-by: 梁超众 <liangchaozhong@xiaomi.com>
This commit is contained in:
@@ -111,6 +111,7 @@ int ipv6_setsockopt(FAR struct socket *psock, int option,
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK)
|
||||
case IPV6_PKTINFO:
|
||||
case IPV6_RECVPKTINFO:
|
||||
{
|
||||
@@ -139,6 +140,7 @@ int ipv6_setsockopt(FAR struct socket *psock, int option,
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* The following IPv6 socket options are defined, but not implemented */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user