From 4ad3c73b3099cfe3b7f1c79ddfe9061809e4ac6d Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 19 Jul 2016 16:57:32 +0100 Subject: [ipv6] Match user expectations for IPv6 settings priorities A reasonable user expectation is that ${net0/ip6} should show the "highest-priority" of the IPv6 addresses, even when multiple IPv6 addresses are active. The expected order of priority is likely to be manually-assigned addresses first, then stateful DHCPv6 addresses, then SLAAC addresses, and lastly link-local addresses. Using ${priority} to enforce an ordering is undesirable since that would affect the priority assigned to each of the net blocks as a whole, so use the sibling ordering capability instead. Signed-off-by: Michael Brown --- src/include/ipxe/ipv6.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/include') diff --git a/src/include/ipxe/ipv6.h b/src/include/ipxe/ipv6.h index 86c8ff924..4dd03f058 100644 --- a/src/include/ipxe/ipv6.h +++ b/src/include/ipxe/ipv6.h @@ -238,6 +238,18 @@ static inline void ipv6_all_routers ( struct in6_addr *addr ) { addr->s6_addr[15] = 2; } +/** IPv6 settings sibling order */ +enum ipv6_settings_order { + /** No address */ + IPV6_ORDER_PREFIX_ONLY = -4, + /** Link-local address */ + IPV6_ORDER_LINK_LOCAL = -3, + /** Address assigned via SLAAC */ + IPV6_ORDER_SLAAC = -2, + /** Address assigned via DHCPv6 */ + IPV6_ORDER_DHCPV6 = -1, +}; + /** IPv6 link-local address settings block name */ #define IPV6_SETTINGS_NAME "link" -- cgit v1.2.3-55-g7522