Whamcloud - gitweb
LU-12411 lnet: Do not allow gateways on remote nets 70/36870/2
authorChris Horn <hornc@cray.com>
Tue, 11 Jun 2019 19:59:31 +0000 (14:59 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Dec 2019 23:05:50 +0000 (23:05 +0000)
A gateway needs to be reachable over some local interface.

Lustre-change: https://review.whamcloud.com/35198
Lustre-commit: 43b35351e9ca258773e89c2d68047e939fb822fb

Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Ib66d4f8fd48d8863097280c480648ab8e29d2767
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36870
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/router.c

index d48ce40..496fe95 100644 (file)
@@ -341,6 +341,13 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway,
        if (lnet_islocalnet(net))       /* it's a local network */
                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));