diff options
Diffstat (limited to 'src/include/ipxe/ipv6.h')
| -rw-r--r-- | src/include/ipxe/ipv6.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/include/ipxe/ipv6.h b/src/include/ipxe/ipv6.h index 6a9aa606c..3cb878262 100644 --- a/src/include/ipxe/ipv6.h +++ b/src/include/ipxe/ipv6.h @@ -194,14 +194,13 @@ static inline int ipv6_eui64 ( struct in6_addr *addr, /** * Construct link-local address via EUI-64 * - * @v addr Address to construct + * @v addr Zeroed address to construct * @v netdev Network device * @ret prefix_len Prefix length, or negative error */ static inline int ipv6_link_local ( struct in6_addr *addr, struct net_device *netdev ) { - memset ( addr, 0, sizeof ( *addr ) ); addr->s6_addr16[0] = htons ( 0xfe80 ); return ipv6_eui64 ( addr, netdev ); } @@ -209,19 +208,28 @@ static inline int ipv6_link_local ( struct in6_addr *addr, /** * Construct solicited-node multicast address * - * @v addr Address to construct + * @v addr Zeroed address to construct * @v unicast Unicast address */ static inline void ipv6_solicited_node ( struct in6_addr *addr, const struct in6_addr *unicast ) { - memset ( addr, 0, sizeof ( *addr ) ); addr->s6_addr16[0] = htons ( 0xff02 ); addr->s6_addr[11] = 1; addr->s6_addr[12] = 0xff; memcpy ( &addr->s6_addr[13], &unicast->s6_addr[13], 3 ); } +/** + * Construct all-routers multicast address + * + * @v addr Zeroed address to construct + */ +static inline void ipv6_all_routers ( struct in6_addr *addr ) { + addr->s6_addr16[0] = htons ( 0xff02 ); + addr->s6_addr[15] = 2; +} + extern struct list_head ipv6_miniroutes; extern struct net_protocol ipv6_protocol __net_protocol; |
