diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-01-17 17:00:19 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-01-17 17:00:19 -0600 |
commit | 3c16cdf2c8abfc8d2ec3b3013c444eda41cc279a (patch) | |
tree | 7815e25c1510a21e84a8136c20b064d784fc663a | |
parent | ffb5807d85fcdbf26083043d172d82187403e7bb (diff) | |
download | nuttx-3c16cdf2c8abfc8d2ec3b3013c444eda41cc279a.tar.gz nuttx-3c16cdf2c8abfc8d2ec3b3013c444eda41cc279a.tar.bz2 nuttx-3c16cdf2c8abfc8d2ec3b3013c444eda41cc279a.zip |
Networking: Fix some errors detected by Travis in configuration that have TCP on and UDP off and vice versa
-rw-r--r-- | nuttx/net/socket/net_close.c | 2 | ||||
-rw-r--r-- | nuttx/net/socket/recvfrom.c | 2 | ||||
-rw-r--r-- | nuttx/net/socket/sendto.c | 11 |
3 files changed, 10 insertions, 5 deletions
diff --git a/nuttx/net/socket/net_close.c b/nuttx/net/socket/net_close.c index 42949baf8..a2ef7e91f 100644 --- a/nuttx/net/socket/net_close.c +++ b/nuttx/net/socket/net_close.c @@ -273,6 +273,7 @@ end_wait: * ****************************************************************************/ +#ifdef CONFIG_NET_TCP static inline void netclose_txnotify(FAR struct socket *psock, FAR struct tcp_conn_s *conn) { @@ -311,6 +312,7 @@ static inline void netclose_txnotify(FAR struct socket *psock, } #endif /* CONFIG_NET_IPv6 */ } +#endif /* CONFIG_NET_TCP */ /**************************************************************************** * Function: netclose_disconnect diff --git a/nuttx/net/socket/recvfrom.c b/nuttx/net/socket/recvfrom.c index cf07e69c7..6bbe9deea 100644 --- a/nuttx/net/socket/recvfrom.c +++ b/nuttx/net/socket/recvfrom.c @@ -1077,6 +1077,7 @@ static void recvfromo_pkt_rxnotify(FAR struct pkt_conn_s *conn) * ****************************************************************************/ +#ifdef CONFIG_NET_UDP static inline void recvfrom_udp_rxnotify(FAR struct socket *psock, FAR struct udp_conn_s *conn) { @@ -1115,6 +1116,7 @@ static inline void recvfrom_udp_rxnotify(FAR struct socket *psock, } #endif /* CONFIG_NET_IPv6 */ } +#endif /* CONFIG_NET_UDP */ /**************************************************************************** * Function: pkt_recvfrom diff --git a/nuttx/net/socket/sendto.c b/nuttx/net/socket/sendto.c index 394dca5d7..f917ef940 100644 --- a/nuttx/net/socket/sendto.c +++ b/nuttx/net/socket/sendto.c @@ -310,6 +310,7 @@ static uint16_t sendto_interrupt(FAR struct net_driver_s *dev, FAR void *conn, * ****************************************************************************/ +#ifdef CONFIG_NET_UDP static inline void sendto_txnotify(FAR struct socket *psock, FAR struct udp_conn_s *conn) { @@ -348,6 +349,7 @@ static inline void sendto_txnotify(FAR struct socket *psock, } #endif /* CONFIG_NET_IPv6 */ } +#endif /* CONFIG_NET_UDP */ /**************************************************************************** * Public Functions @@ -424,10 +426,8 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, { #ifdef CONFIG_NET_UDP FAR struct udp_conn_s *conn; -#ifdef CONFIG_NET_IPv6 - FAR const struct sockaddr_in6 *into = (const struct sockaddr_in6 *)to; -#else - FAR const struct sockaddr_in *into = (const struct sockaddr_in *)to; +#ifdef CONFIG_NET_ARP_SEND + FAR const struct sockaddr_in *into; #endif struct sendto_s state; net_lock_t save; @@ -484,6 +484,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, /* Make sure that the IP address mapping is in the ARP table */ #ifdef CONFIG_NET_ARP_SEND + into = (FAR const struct sockaddr_in *)to; ret = arp_send(into->sin_addr.s_addr); if (ret < 0) { @@ -582,7 +583,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, return state.st_sndlen; #else err = ENOSYS; -#endif +#endif /* CONFIG_NET_UDP */ errout: set_errno(err); |