ip6_addr_select_zone macro
Try to select a zone for a scoped address that does not yet have a zone. Called from PCB bind and connect routines, for two reasons: 1) to save on this (relatively expensive) selection for every individual packet route operation and 2) to allow the application to obtain the selected zone from the PCB as is customary for e.g. getsockname/getpeername BSD socket calls. Ideally, callers would always supply a properly zoned address, in which case this function would not be needed. It exists both for compatibility with the BSD socket API (which accepts zoneless destination addresses) and for backward compatibility with pre-scoping lwIP code. It may be impossible to select a zone, e.g. if there are no netifs. In that case, the address's zone field will be left as is.
Arguments
dest
the IPv6 address for which to select and set a zone.
src
source IPv6 address (const); may be equal to dest.