summaryrefslogtreecommitdiff
path: root/nuttx/net/tcp
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-15 15:55:52 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-15 15:55:52 -0600
commit363051f66bbd5a817e2f644cc2a5c11579f7a2f3 (patch)
tree615ec2f981bd39dca91f1be0453d9605dad41769 /nuttx/net/tcp
parent425b313cb3bc53c5cc49f98ad8236ea6675ad9df (diff)
downloadpx4-nuttx-363051f66bbd5a817e2f644cc2a5c11579f7a2f3.tar.gz
px4-nuttx-363051f66bbd5a817e2f644cc2a5c11579f7a2f3.tar.bz2
px4-nuttx-363051f66bbd5a817e2f644cc2a5c11579f7a2f3.zip
Clean a few more IPv6 compilation issues; Add implementation of net_ipv6_maskcmp()
Diffstat (limited to 'nuttx/net/tcp')
-rw-r--r--nuttx/net/tcp/tcp_poll.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/nuttx/net/tcp/tcp_poll.c b/nuttx/net/tcp/tcp_poll.c
index 2d05e452c..0f6175638 100644
--- a/nuttx/net/tcp/tcp_poll.c
+++ b/nuttx/net/tcp/tcp_poll.c
@@ -101,10 +101,18 @@ void tcp_poll(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn)
if ((conn->tcpstateflags & TCP_STATE_MASK) == TCP_ESTABLISHED)
{
- /* Set up for the callback */
+ /* Set up for the callback. We can't know in advance if the application
+ * is going to send a IPv4 or an IPv6 packet, so this setup may not
+ * actually be used.
+ */
+#if defined(CONFIG_NET_IPv4)
dev->d_snddata = &dev->d_buf[IPv4TCP_HDRLEN + NET_LL_HDRLEN(dev)];
dev->d_appdata = &dev->d_buf[IPv4TCP_HDRLEN + NET_LL_HDRLEN(dev)];
+#else /* if defined(CONFIG_NET_IPv6) */
+ dev->d_snddata = &dev->d_buf[IPv6TCP_HDRLEN + NET_LL_HDRLEN(dev)];
+ dev->d_appdata = &dev->d_buf[IPv6TCP_HDRLEN + NET_LL_HDRLEN(dev)];
+#endif
dev->d_len = 0;
dev->d_sndlen = 0;