Merged in rtakacs/nuttx/fix_getsockname (pull request #410)
Support listening sockets in the getsockname function Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
commit
175a49a746
|
@ -157,6 +157,10 @@ int ipv4_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||
|
||||
#ifdef CONFIG_NETDEV_MULTINIC
|
||||
/* Find the device matching the IPv4 address in the connection structure */
|
||||
if (ripaddr == 0)
|
||||
{
|
||||
ripaddr = lipaddr;
|
||||
}
|
||||
|
||||
dev = netdev_findby_ipv4addr(lipaddr, ripaddr);
|
||||
#else
|
||||
|
@ -280,6 +284,10 @@ int ipv6_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||
|
||||
#ifdef CONFIG_NETDEV_MULTINIC
|
||||
/* Find the device matching the IPv6 address in the connection structure */
|
||||
if (*ripaddr == 0)
|
||||
{
|
||||
ripaddr = lipaddr;
|
||||
}
|
||||
|
||||
dev = netdev_findby_ipv6addr(*lipaddr, *ripaddr);
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue