lkml.org 
[lkml]   [2021]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] arp: Remove the arp_hh_ops structure
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;
> > }
> >
>

\
 
 \ /
  Last update: 2021-02-21 03:22    [W:0.083 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site