From daa04c2eae933b8cbcda3fa7885e52cfba52f430 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 22 Jun 2018 10:14:47 -0600 Subject: [PATCH] net/udp: Fix yet another confusion between raddr and laddr introduced in a recent change. --- net/udp/udp_finddev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/udp/udp_finddev.c b/net/udp/udp_finddev.c index 8e77140b833..2139bc1ca94 100644 --- a/net/udp/udp_finddev.c +++ b/net/udp/udp_finddev.c @@ -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