net/udp: Fix yet another confusion between raddr and laddr introduced in a recent change.

This commit is contained in:
Gregory Nutt 2018-06-22 10:14:47 -06:00
parent 66db9f09f6
commit daa04c2eae

View File

@ -195,14 +195,14 @@ FAR struct net_driver_s *udp_find_raddr_device(FAR struct udp_conn_s *conn)
* using the locally bound address (assuming that there is one).
*
* The general form of all well-known, reserved IPv6 multicast
* addresses is: ff0x::xx/16 (which does not include all possible
* multicast addresses).
* addresses is: ff0x::xx/16 (which includes most, but not all
* possible multicast addresses).
*/
if ((conn->u.ipv6.laddr[0] & HTONS(0xfff0)) == HTONS(0xff00) &&
conn->u.ipv6.laddr[1] == 0 && conn->u.ipv6.laddr[2] == 0 &&
conn->u.ipv6.laddr[3] == 0 && conn->u.ipv6.laddr[4] == 0 &&
conn->u.ipv6.laddr[5] == 0 && conn->u.ipv6.laddr[6] == 0)
if ((conn->u.ipv6.raddr[0] & HTONS(0xfff0)) == HTONS(0xff00) &&
conn->u.ipv6.raddr[1] == 0 && conn->u.ipv6.raddr[2] == 0 &&
conn->u.ipv6.raddr[3] == 0 && conn->u.ipv6.raddr[4] == 0 &&
conn->u.ipv6.raddr[5] == 0 && conn->u.ipv6.raddr[6] == 0)
{
/* Make sure that the socket is bound to some non-zero, local
* address. Zero is used as an indication that the laddr is