Browse Source

net: ipv6: Fix net_ipv6_is_addr_mcast_group() check

Some bytes were compared twice and one comparison used wrong index.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
pull/91526/merge
Robert Lubos 1 week ago committed by Daniel DeGrasse
parent
commit
9b00a1d656
  1. 4
      include/zephyr/net/net_ip.h

4
include/zephyr/net/net_ip.h

@ -1299,10 +1299,8 @@ static inline bool net_ipv6_is_addr_mcast_group(const struct in6_addr *addr, @@ -1299,10 +1299,8 @@ static inline bool net_ipv6_is_addr_mcast_group(const struct in6_addr *addr,
const struct in6_addr *group)
{
return UNALIGNED_GET(&addr->s6_addr16[1]) == group->s6_addr16[1] &&
UNALIGNED_GET(&addr->s6_addr16[2]) == group->s6_addr16[2] &&
UNALIGNED_GET(&addr->s6_addr16[3]) == group->s6_addr16[3] &&
UNALIGNED_GET(&addr->s6_addr32[1]) == group->s6_addr32[1] &&
UNALIGNED_GET(&addr->s6_addr32[2]) == group->s6_addr32[1] &&
UNALIGNED_GET(&addr->s6_addr32[2]) == group->s6_addr32[2] &&
UNALIGNED_GET(&addr->s6_addr32[3]) == group->s6_addr32[3];
}

Loading…
Cancel
Save