Send the gateway name to this function. Fixes #4047