Moved ipv6 hook registration inside ifdef.