mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
More cosmetic changes: Fix some errors in comments and some indentation problems
This commit is contained in:
+15
-15
@@ -95,7 +95,7 @@ ssize_t psock_udp_send(FAR struct socket *psock, FAR const void *buf,
|
|||||||
|
|
||||||
if (!_SS_ISCONNECTED(psock->s_flags))
|
if (!_SS_ISCONNECTED(psock->s_flags))
|
||||||
{
|
{
|
||||||
/* Now, then it is not legal to call send */
|
/* No, then it is not legal to call send() with this socket. */
|
||||||
|
|
||||||
return -ENOTCONN;
|
return -ENOTCONN;
|
||||||
}
|
}
|
||||||
@@ -104,26 +104,26 @@ ssize_t psock_udp_send(FAR struct socket *psock, FAR const void *buf,
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_IPv4
|
#ifdef CONFIG_NET_IPv4
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
if (conn->domain == PF_INET)
|
if (conn->domain == PF_INET)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
tolen = sizeof(struct sockaddr_in);
|
tolen = sizeof(struct sockaddr_in);
|
||||||
to.addr4.sin_family = AF_INET;
|
to.addr4.sin_family = AF_INET;
|
||||||
to.addr4.sin_port = conn->rport;
|
to.addr4.sin_port = conn->rport;
|
||||||
net_ipv4addr_copy(to.addr4.sin_addr.s_addr, conn->u.ipv4.raddr);
|
net_ipv4addr_copy(to.addr4.sin_addr.s_addr, conn->u.ipv4.raddr);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_NET_IPv4 */
|
#endif /* CONFIG_NET_IPv4 */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
#ifdef CONFIG_NET_IPv4
|
#ifdef CONFIG_NET_IPv4
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
tolen = sizeof(struct sockaddr_in6);
|
tolen = sizeof(struct sockaddr_in6);
|
||||||
to.addr6.sin6_family = AF_INET6;
|
to.addr6.sin6_family = AF_INET6;
|
||||||
to.addr6.sin6_port = conn->rport;
|
to.addr6.sin6_port = conn->rport;
|
||||||
net_ipv6addr_copy(to.addr6.sin6_addr.s6_addr, conn->u.ipv6.raddr);
|
net_ipv6addr_copy(to.addr6.sin6_addr.s6_addr, conn->u.ipv6.raddr);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_NET_IPv6 */
|
#endif /* CONFIG_NET_IPv6 */
|
||||||
|
|
||||||
return psock_udp_sendto(psock, buf, len, 0, &to.addr, tolen);
|
return psock_udp_sendto(psock, buf, len, 0, &to.addr, tolen);
|
||||||
|
|||||||
Reference in New Issue
Block a user