[openib-general] [PATCH] OpenSM/ib_types.h: In ib_gid_is_link_local, only compare /10 to default subnet prefix to determine is link local

Jason Gunthorpe jgunthorpe at obsidianresearch.com
Tue Jan 2 17:25:55 PST 2007


On Tue, Jan 02, 2007 at 07:03:42PM -0500, Hal Rosenstock wrote:
> -	return( ib_gid_get_subnet_prefix( p_gid ) == IB_DEFAULT_SUBNET_PREFIX );
> +	return( ( ib_gid_get_subnet_prefix( p_gid ) &
> +		CL_HTON64( 0xFFE0000000000000ULL ) ) == IB_DEFAULT_SUBNET_PREFIX );

Should be FFC, ie:

#define IN6_IS_ADDR_LINKLOCAL(a) \
        ((((__const uint32_t *) (a))[0] & htonl (0xffc00000))	\
         == htonl (0xfe800000))

Jason




More information about the general mailing list