Apply vendor revision 470df104c6f55f6d6f390df7448d8eb65c7642b9:
From: Guy Harris <guy@alum.mit.edu>
Subject: [PATCH] Fix compilation if INET6 isn't defined.
Addresses GitHub issue #541, but differently from the pull request (it
defines gen_gateway() with a function prototype rather than using a
pre-prototype-style definition).