From 7c12c24c8a10be2d0ad005d6d99d97cee6bcde18 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Fri, 26 Jul 2019 16:08:00 -0500 Subject: [PATCH] LU-12595 lnet: Return EHOSTUNREACH for unreachable gateway 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 Change-Id: Ia0f28779a3505eff02dafdc23a6e01c1d0cbc84b Reviewed-on: https://review.whamcloud.com/35630 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alexey Lyashkov Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- lnet/lnet/router.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index 972c968..886098f 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -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 */ -- 1.8.3.1