Logformat %lp expands to "-" in wildcard listening port configs (#997)
FindListeningPortAddress() and its helpers look for "local" address of
an accepted connection. When FindListeningPortAddress() is called in %la
context, we must skip Ip::Address objects with INADDR_ANY IP addresses
because we are looking for a specific IP address, not a wildcard.
However, when called in %lp context, skipping those Ip::Address objects
may, in some cases, result in skipping the only object that actually
contains the port information, resulting in %lp expanding to "-".
Similarly, zero-port Ip::Address objects (with non-any IPs) could be, in
theory, returned instead of continuing the search for an object with a
non-zero port number, although this case was not observed in tests.
Now we configure the address searching helpers with a "good Ip::Address
object" filter so that each %code code path can customize its search.
The problem was introduced in commit
ea35939 that expanded INADDR_ANY
check scope from %la to %lp.