Rtos API example
Modules | |
MLD6 | |
Multicast listener discovery for IPv6. | |
Functions | |
const ip_addr_t * | ip6_select_source_address (struct netif *netif, const ip6_addr_t *dest) |
Select the best IPv6 source address for a given destination IPv6 address. |
Function Documentation
const ip_addr_t* ip6_select_source_address | ( | struct netif * | netif, |
const ip6_addr_t * | dest | ||
) |
Select the best IPv6 source address for a given destination IPv6 address.
This implementation follows RFC 6724 Sec. 5 to the following extent:
- Rules 1, 2, 3: fully implemented
- Rules 4, 5, 5.5: not applicable
- Rule 6: not implemented
- Rule 7: not applicable
- Rule 8: limited to "prefer /64 subnet match over non-match"
For Rule 2, we deliberately deviate from RFC 6724 Sec. 3.1 by considering ULAs to be of smaller scope than global addresses, to avoid that a preferred ULA is picked over a deprecated global address when given a global address as destination, as that would likely result in broken two-way communication.
As long as temporary addresses are not supported (as used in Rule 7), a proper implementation of Rule 8 would obviate the need to implement Rule 6.
- Parameters:
-
netif the netif on which to send a packet dest the destination we are trying to reach
- Returns:
- the most suitable source address to use, or NULL if no suitable source address is found
Definition at line 227 of file lwip_ip6.c.
Generated on Sun Jul 17 2022 08:25:37 by 1.7.2