Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Apr 2016 10:12:21 -0700
From:      Ngie Cooper <yaneurabeya@gmail.com>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>,  "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core
Message-ID:  <CAGHfRMC3UW6dAy6cW%2B8EJ1f=RxQy%2BTJV1dvHozGhaSmUWqAdNA@mail.gmail.com>
In-Reply-To: <201604211604.u3LG4wmT035874@repo.freebsd.org>
References:  <201604211604.u3LG4wmT035874@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 21, 2016 at 9:04 AM, Hans Petter Selasky
<hselasky@freebsd.org> wrote:
> Author: hselasky
> Date: Thu Apr 21 16:04:58 2016
> New Revision: 298412
> URL: https://svnweb.freebsd.org/changeset/base/298412
>
> Log:
>   Fix for resolving mac address when the destination address is a gateway.
>   Remove some dead code while at it.
>
>   Sponsored by: Mellanox Technologies
>   MFC after:    1 week
>
> Modified:
>   head/sys/ofed/drivers/infiniband/core/addr.c
>
> Modified: head/sys/ofed/drivers/infiniband/core/addr.c
> ==============================================================================
> --- head/sys/ofed/drivers/infiniband/core/addr.c        Thu Apr 21 15:38:28 2016        (r298411)
> +++ head/sys/ofed/drivers/infiniband/core/addr.c        Thu Apr 21 16:04:58 2016        (r298412)
> @@ -333,17 +333,18 @@ mcast:
>         switch (dst_in->sa_family) {
>  #ifdef INET
>         case AF_INET:
> -               error = arpresolve(ifp, is_gw, NULL, dst_in, edst, NULL);
> +               error = arpresolve(ifp, is_gw, NULL,
> +                   is_gw ? rte->rt_gateway : dst_in, edst, NULL);
>                 break;
>  #endif
>  #ifdef INET6
>         case AF_INET6:
> -               error = nd6_resolve(ifp, is_gw, NULL, dst_in, edst, NULL);
> +               error = nd6_resolve(ifp, is_gw, NULL,
> +                   is_gw ? rte->rt_gateway : dst_in, edst, NULL);
>                 break;
>  #endif
>         default:
> -               /* XXX: Shouldn't happen. */
> -               error = -EINVAL;
> +               break;
>         }
>         RTFREE(rte);
>         if (error == 0) {

Please put the "deadcode" back. It will crash now if it's given an
invalid address family (or none are configured in the kernel) when it
tries to do the memcpy below.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGHfRMC3UW6dAy6cW%2B8EJ1f=RxQy%2BTJV1dvHozGhaSmUWqAdNA>