APPS: Guard use of IPv6 functions and constants with a check of AF_INET6