linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yejune Deng <yejune.deng@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	yoshfuji@linux-ipv6.org, dsahern@kernel.org,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arp: Remove the arp_hh_ops structure
Date: Sun, 21 Feb 2021 10:20:44 +0800	[thread overview]
Message-ID: <CABWKuGW5bvPDvNv5=Fj_=f9=gk--=_w28jsCJ8MK5t7ysK+s8g@mail.gmail.com> (raw)
In-Reply-To: <3b69191b-9bd5-9050-9126-17b4905a67e9@gmail.com>

Sorry,it was my fault, I will resubmit.

On Sun, Feb 21, 2021 at 9:54 AM David Ahern <dsahern@gmail.com> wrote:
>
> On 2/19/21 9:32 PM, Yejune Deng wrote:
> >  static const struct neigh_ops arp_direct_ops = {
> >       .family =               AF_INET,
> >       .output =               neigh_direct_output,
> > @@ -277,15 +269,10 @@ static int arp_constructor(struct neighbour *neigh)
> >                       memcpy(neigh->ha, dev->broadcast, dev->addr_len);
> >               }
> >
> > -             if (dev->header_ops->cache)
> > -                     neigh->ops = &arp_hh_ops;
> > -             else
> > -                     neigh->ops = &arp_generic_ops;
>
> How did you test this?
>
> you took out the neigh->ops assignment, so all of the neigh->ops in
> net/core/neighbour.c are going to cause a NULL dereference.
>
>
> > -
> > -             if (neigh->nud_state & NUD_VALID)
> > -                     neigh->output = neigh->ops->connected_output;
> > +             if (!dev->header_ops->cache && (neigh->nud_state & NUD_VALID))
> > +                     neigh->output = arp_generic_ops.connected_output;
> >               else
> > -                     neigh->output = neigh->ops->output;
> > +                     neigh->output = arp_generic_ops.output;
> >       }
> >       return 0;
> >  }
> >
>

  reply	other threads:[~2021-02-21  2:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20  4:32 [PATCH] arp: Remove the arp_hh_ops structure Yejune Deng
2021-02-21  1:54 ` David Ahern
2021-02-21  2:20   ` Yejune Deng [this message]
2021-02-21 15:04 ` [arp] 4591591ab7: RIP:neigh_probe kernel test robot
2021-02-22  3:15 [PATCH] arp: Remove the arp_hh_ops structure Yejune Deng
2021-02-22  8:37 ` Eric Dumazet
2021-02-22 16:07   ` David Ahern
2021-02-23  7:00     ` Yejune Deng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABWKuGW5bvPDvNv5=Fj_=f9=gk--=_w28jsCJ8MK5t7ysK+s8g@mail.gmail.com' \
    --to=yejune.deng@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).