Whamcloud - gitweb
LU-12595 lnet: Return EHOSTUNREACH for unreachable gateway 30/35630/3
authorChris Horn <hornc@cray.com>
Fri, 26 Jul 2019 21:08:00 +0000 (16:08 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 9 Aug 2019 04:41:18 +0000 (04:41 +0000)
Commit 43b35351e9ca258773e89c2d68047e939fb822fb contains a flaw in
that it shouldn't be a fatal error to encounter an unreachable
gateway when parsing routes. Parsing should continue in case there
are any valid, reachable routes that are being added. Returning EINAL
here will cause a failure to load the LNet module. lnet_parse_route()
explicitly allows for lnet_add_route() to return EHOSTUNREACH for
just this purpose.

Test-parameters: trivial
Fixes: 43b35351e9 ("LU-12411 lnet: Do not allow gateways on remote nets")
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Ia0f28779a3505eff02dafdc23a6e01c1d0cbc84b
Reviewed-on: https://review.whamcloud.com/35630
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/router.c

index 972c968..886098f 100644 (file)
@@ -469,7 +469,7 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t 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;
+               return -EHOSTUNREACH;
        }
 
        /* Assume net, route, all new */