diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c index 81f7a94..f7b53e0 100644 --- a/net/lnet/lnet/router.c +++ b/net/lnet/lnet/router.c @@ -436,6 +436,13 @@ static void lnet_shuffle_seed(void) if (lnet_islocalnet(net)) return -EEXIST; + if (!lnet_islocalnet(LNET_NIDNET(gateway))) { + CERROR("Cannot add route with gateway %s. There is no local interface configured on LNet %s\n", + libcfs_nid2str(gateway), + libcfs_net2str(LNET_NIDNET(gateway))); + return -EINVAL; + } + /* Assume net, route, all new */ route = kzalloc(sizeof(*route), GFP_NOFS); rnet = kzalloc(sizeof(*rnet), GFP_NOFS);