summaryrefslogtreecommitdiff
path: root/nuttx/net/socket/recvfrom.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/net/socket/recvfrom.c')
-rw-r--r--nuttx/net/socket/recvfrom.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nuttx/net/socket/recvfrom.c b/nuttx/net/socket/recvfrom.c
index 160246715..a16f23c2b 100644
--- a/nuttx/net/socket/recvfrom.c
+++ b/nuttx/net/socket/recvfrom.c
@@ -74,8 +74,13 @@
* Pre-processor Definitions
****************************************************************************/
-#define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
-#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
+#if defined(CONFIG_NET_IPv4)
+# define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
+# define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
+#elif defined(CONFIG_NET_IPv6)
+# define UDPBUF ((struct udp_ipv6hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
+# define TCPBUF ((struct tcp_ipv6hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
+#endif
/****************************************************************************
* Private Types