]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
infiniband: call ipv6 route lookup via the stub interface
authorPaolo Abeni <pabeni@redhat.com>
Fri, 28 Apr 2017 09:20:01 +0000 (11:20 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 20 Jun 2017 10:17:48 +0000 (12:17 +0200)
BugLink: http://bugs.launchpad.net/bugs/1694621
commit eea40b8f624f25cbc02d55f2d93203f60cee9341 upstream.

The infiniband address handle can be triggered to resolve an ipv6
address in response to MAD packets, regardless of the ipv6
module being disabled via the kernel command line argument.

That will cause a call into the ipv6 routing code, which is not
initialized, and a conseguent oops.

This commit addresses the above issue replacing the direct lookup
call with an indirect one via the ipv6 stub, which is properly
initialized according to the ipv6 status (e.g. if ipv6 is
disabled, the routing lookup fails gracefully)

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/infiniband/core/addr.c

index 34b1adad07aacf92e9bbfa9621e084f2ec756f74..6a8024d9d742e3ecad84f3ed45bcdc7be21895d0 100644 (file)
@@ -277,8 +277,8 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
        fl6.saddr = src_in->sin6_addr;
        fl6.flowi6_oif = addr->bound_dev_if;
 
-       dst = ip6_route_output(addr->net, NULL, &fl6);
-       if ((ret = dst->error))
+       ret = ipv6_stub->ipv6_dst_lookup(addr->net, NULL, &dst, &fl6);
+       if (ret < 0)
                goto put;
 
        if (ipv6_addr_any(&fl6.saddr)) {