From 2903b476c71387d06fe7003bb33879eb08ce2872 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Sat, 4 Feb 2017 13:56:13 +0000 Subject: [PATCH] ip6: fix parentheses in ip6_addr_has_scope Both of the multicast checks should be skipped if the address type is unicast. This bug accidentally caused only one of them to be skipped, resulting in some unnecessary performance overhead. Reported by Axel Lin. --- src/include/lwip/ip6_zone.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/lwip/ip6_zone.h b/src/include/lwip/ip6_zone.h index 41a9c909..7689dc1e 100644 --- a/src/include/lwip/ip6_zone.h +++ b/src/include/lwip/ip6_zone.h @@ -157,9 +157,9 @@ * @return 1 if the address has a constrained scope, 0 if it does not. */ #define ip6_addr_has_scope(ip6addr, type) \ - (ip6_addr_islinklocal(ip6addr) || ((((type) != IP6_UNICAST) && \ - ip6_addr_ismulticast_iflocal(ip6addr)) || \ - ip6_addr_ismulticast_linklocal(ip6addr))) + (ip6_addr_islinklocal(ip6addr) || (((type) != IP6_UNICAST) && \ + (ip6_addr_ismulticast_iflocal(ip6addr) || \ + ip6_addr_ismulticast_linklocal(ip6addr)))) /** * Assign a zone index to an IPv6 address, based on a network interface. If the