diff mbox series

[10/22] lnet: fix build issue when IPv6 is disabled.

Message ID 1668953828-10909-11-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: backport OpenSFS work as of Nov 20, 2022 | expand

Commit Message

James Simmons Nov. 20, 2022, 2:16 p.m. UTC
struct inet6_dev and struct inet6_ifaddr are not defined if IPv6
is not configured for the Linux kernel.

Fixes: 351a6df78c3 ("lnet: support IPv6 in lnet_inet_enumerate()")
WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: 896cd5b7bcf94d4fd ("LU-10391 lnet: fix build issue when IPv6 is disabled.")
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48990
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
---
 net/lnet/lnet/config.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/net/lnet/lnet/config.c b/net/lnet/lnet/config.c
index 4b2d776..5bfae4e 100644
--- a/net/lnet/lnet/config.c
+++ b/net/lnet/lnet/config.c
@@ -1501,8 +1501,10 @@  int lnet_inet_enumerate(struct lnet_inetdev **dev_list, struct net *ns, bool v6)
 		int flags = dev_get_flags(dev);
 		const struct in_ifaddr *ifa;
 		struct in_device *in_dev;
+#if IS_ENABLED(CONFIG_IPV6)
 		struct inet6_dev *in6_dev;
 		const struct inet6_ifaddr *ifa6;
+#endif
 		int node_id;
 		int cpt;