If I'd read the current RFC (rfc4291 section 2.7) I might me better
informed. There is also the P and R flags to be concerned with. And-ing
with 0xff8f0000UL may be more appropriate.

Regards,

Ian
On 13/12/14 18:52, Ian wrote:
> If I read RFC1884 (section 2.6) correctly the ip6_addr_ismulticast_*
> macros need to allow for the T-bit=1 indicating that a transient
> multicast address is being used. The following diff shows the changes
> I've made locally.
>
> Regards,
>
> Ian
>
> diff --git a/ethernet/lwip-git/src/include/ipv6/lwip/ip6_addr.h
> b/ethernet/lwip-git/src/include/ipv6/lwip/ip6_addr.h
> index 4e5f4a2..7046b57 100644
> --- a/ethernet/lwip-git/src/include/ipv6/lwip/ip6_addr.h
> +++ b/ethernet/lwip-git/src/include/ipv6/lwip/ip6_addr.h
> @@ -195,12 +195,12 @@ Little-endian version, stored in network order (no
> htonl). */
>  #define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL  0x8
>  #define IP6_MULTICAST_SCOPE_GLOBAL              0xe
>  #define IP6_MULTICAST_SCOPE_RESERVEDF           0xf
> -#define ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff010000UL))
> -#define ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff020000UL))
> -#define ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff040000UL))
> -#define ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff050000UL))
> -#define ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff080000UL))
> -#define ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff0e0000UL))
> +#define ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffef0000UL)) == PP_HTONL(0xff010000UL))
> +#define ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffef0000UL)) == PP_HTONL(0xff020000UL))
> +#define ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffef0000UL)) == PP_HTONL(0xff040000UL))
> +#define ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffef0000UL)) == PP_HTONL(0xff050000UL))
> +#define ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffef0000UL)) == PP_HTONL(0xff080000UL))
> +#define ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] &
> PP_HTONL(0xffef0000UL)) == PP_HTONL(0xff0e0000UL))
>  
>  /* TODO define get/set for well-know multicast addresses, e.g. ff02::1 */
>  #define ip6_addr_isallnodes_iflocal(ip6addr) (((ip6addr)->addr[0] ==
> PP_HTONL(0xff010000UL)) && \
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users

diff --git a/ethernet/lwip-git/src/include/ipv6/lwip/ip6_addr.h b/ethernet/lwip-git/src/include/ipv6/lwip/ip6_addr.h
index 4e5f4a2..0076008 100644
--- a/ethernet/lwip-git/src/include/ipv6/lwip/ip6_addr.h
+++ b/ethernet/lwip-git/src/include/ipv6/lwip/ip6_addr.h
@@ -195,12 +195,12 @@ Little-endian version, stored in network order (no htonl). */
 #define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL  0x8
 #define IP6_MULTICAST_SCOPE_GLOBAL              0xe
 #define IP6_MULTICAST_SCOPE_RESERVEDF           0xf
-#define ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff010000UL))
-#define ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff020000UL))
-#define ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff040000UL))
-#define ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff050000UL))
-#define ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff080000UL))
-#define ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff0e0000UL))
+#define ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff010000UL))
+#define ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff020000UL))
+#define ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff040000UL))
+#define ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff050000UL))
+#define ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff080000UL))
+#define ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff0e0000UL))
 
 /* TODO define get/set for well-know multicast addresses, e.g. ff02::1 */
 #define ip6_addr_isallnodes_iflocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff010000UL)) && \
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to