RDMA/addr: Disable ipv6 features when ipv6.disable set in cmdline
PATCH 1/1 RDMA/addr: Disable ipv6 features when ipv6.disable set in cmdline
From: Zhu Yanjun <[email protected]>
When ipv6.disable=1 is set in cmdline, ipv6 is actually disabled in the stack. As such, the operations of ipv6 will fail. So ipv6 features in addr should also be disabled.
Fixes caf1e3ae9fa6 ("RDMA/core Introduce and use rdma_find_ndev_for_src_ip_rcu")
Suggested-by Jason Gunthorpe <[email protected]>
Signed-off-by Zhu Yanjun <[email protected]>
--- drivers/infiniband/core/addr.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/infiniband/core/addr.c +6 -0
@@ -257,6 +257,9 @@ rdma_find_ndev_for_src_ip_rcu(struct net *net, const struct sockaddr *src_in)break ;#if IS_ENABLED (CONFIG_IPV6 )case AF_INET6 : +if (!ipv6_mod_enabled ()) +return ERR_PTR (-EPFNOSUPPORT ); +for_each_netdev_rcu (net, dev) { if (ipv6_chk_addr(net, &((const struct sockaddr_in6 *)src_in)->sin6_addr,
@@ -424,6 +427,9 @@ static int addr6_resolve(struct sockaddr *src_sock,struct flowi6 fl6;struct dst_entry *dst; +if (!ipv6_mod_enabled ()) +return -EADDRNOTAVAIL ; +memset (&fl6,0 ,sizeof fl6); fl6.daddr = dst_in->sin6_addr; fl6.saddr = src_in->sin6_addr;
Signature · 1 line
2.27.0
Quoted 9 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
When ipv6.disable=1 is set in cmdline, ipv6 is actually disabled in the stack. As such, the operations of ipv6 will fail. So ipv6 features in addr should also be disabled.
Fixes caf1e3ae9fa6 ("RDMA/core Introduce and use rdma_find_ndev_for_src_ip_rcu")Suggested-by Jason Gunthorpe <[email protected]>
Hi, Jason
Gently ping
Quoted 32 lines
Signed-off-by Zhu Yanjun <[email protected]>--- drivers/infiniband/core/addr.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/infiniband/core/addr.c +6
-1@@ -257,6 +257,9 @@ rdma_find_ndev_for_src_ip_rcu(struct net *net, const struct sockaddr *src_in)break ;#if IS_ENABLED (CONFIG_IPV6 )case AF_INET6 : +if (!ipv6_mod_enabled ()) +return ERR_PTR (-EPFNOSUPPORT ); +for_each_netdev_rcu (net, dev) { if (ipv6_chk_addr(net, &((const struct sockaddr_in6 *)src_in)->sin6_addr,@@ -424,6 +427,9 @@ static int addr6_resolve(struct sockaddr *src_sock,struct flowi6 fl6;struct dst_entry *dst; +if (!ipv6_mod_enabled ()) +return -EADDRNOTAVAIL ; +memset (&fl6,0 ,sizeof fl6); fl6.daddr = dst_in->sin6_addr; fl6.saddr = src_in->sin6_addr; --2.27.0