[ipv6] Fix definition of IN6_IS_ADDR_LINKLOCAL()

Fix an erroneous htonl() in the definition of IN6_IS_ADDR_LINKLOCAL(),
and add self-tests for the IN6_IS_ADDR_xxx() family of macros.

Reported-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2014-05-21 17:51:31 +01:00
parent 6cdd3bb656
commit 3c7f5f9c4c
2 changed files with 39 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ struct in6_addr {
#define IN6_IS_ADDR_LINKLOCAL( addr ) \
( ( *( ( const uint16_t * ) (addr) ) & htons ( 0xffc0 ) ) == \
htonl ( 0xfe80 ) )
htons ( 0xfe80 ) )
/**
* IPv4 socket address