A gateway needs to be reachable over some local interface.
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Ib66d4f8fd48d8863097280c480648ab8e29d2767
Reviewed-on: https://review.whamcloud.com/35198
Tested-by: Jenkins
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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 */
LIBCFS_ALLOC(route, sizeof(*route));
LIBCFS_ALLOC(rnet, sizeof(*rnet));