Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp665335pxb; Sat, 20 Feb 2021 17:59:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCzJToDwn4Mhq3RlWLzLbNidrVomGD/Ao6U1kZ/nrRcmjaRMc+o2aXW7tz2+ji5quzRLv4 X-Received: by 2002:aa7:d9c4:: with SMTP id v4mr6879233eds.15.1613872787690; Sat, 20 Feb 2021 17:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613872787; cv=none; d=google.com; s=arc-20160816; b=EtuTn67dYCcTx7Prr0lZeMuCoEkupRrRBd0EggF8zBxvilMwPtN8HS25PMBXQDFwsL DxV/aflKyHTaWCuHYWmih7/dS0infVBd16yDppZZTj1RkXQk+NRAIDKwydr5w7lUNxx6 1Oc+AWVAWrRG5YjccK7H9E/IleoHdl2xVlVRjgloNDgVTSNpBxBf7Lq1XuoYP6djVpSA vKKWL+PnoZ8zeFx+2Ic6b3pY+NHyUeXVBjDuVoMp4tACFvAU1tBSnt+cybevcn8XfgS3 4FGtTYDhGYjlpSHb/g4hbcivlKHtoPWS3+2gjtiGo5qxDi9e+Q3AQxYfAIOyejW/xphk 5UHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2YeG2HTU6ffO0nhsXtBfvb2LSJCOeXJuMNGMXF/3az4=; b=HAI1W6cRUjK8g+sk5addarFOU35C79geYLZ9BkAfN6huHYKGtDK5IqiwzjHLAxwgyk DFw22+L7Q6HP1K/GkgK5hujB76xO6/b0WW3NHsOshSvn8lr8Rk14MiGp272wJGsXA2jp wjcHM1cvNW/fxslT8nhPY5KArWLBx7xNi4iURg9UcGIvTlxLXh36gPyJonOUm8nOdzcD nx+3GQIg9qW7z5ZaTX/7Aq894j4gcAzf9FRlA5JkpFZ3y/4aNQ1i3MvU25+GdiEyKrGZ dTfhO0H4+807tKDnqv3GuxpIga3yYf3+KpLGlNuqpawW73e/6XdROPe/yiMcTTjNCd5V fWAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LyqUox4g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si5193792edt.112.2021.02.20.17.59.23; Sat, 20 Feb 2021 17:59:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LyqUox4g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbhBUByw (ORCPT + 99 others); Sat, 20 Feb 2021 20:54:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhBUByv (ORCPT ); Sat, 20 Feb 2021 20:54:51 -0500 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09F0AC061574; Sat, 20 Feb 2021 17:54:11 -0800 (PST) Received: by mail-oi1-x22c.google.com with SMTP id o3so673381oic.8; Sat, 20 Feb 2021 17:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2YeG2HTU6ffO0nhsXtBfvb2LSJCOeXJuMNGMXF/3az4=; b=LyqUox4giymneLKtYSf9GSOLBlfSZAqrA47Y54NRxAJDnqQKWi+TEZlKclVIaodEsC +i1OierxMLQDRH4YfySHAz4FCz2dQksO/uEsgk8kq7n/Ot5+63l2rHUWkXTmMIKa51rm 3v2f4QIKJScvULohfCGv36QmGsIO9BidKPmXyZDOQgFN9BZiUu1ywDR1J/zZm2ZggRHF pwGW5mjE4+wmV7ZQgy4x6oglMG2MG3Oa+/T5nGRyv6FjuQ231wUPzpxMlx9OkN6GbgcH THFs/low3d0mK+1iWXLkqkKbbHyYYUDZpqBLvHwkLD4bee+R5o5nVGr28gaUeNKl9Ewr apvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2YeG2HTU6ffO0nhsXtBfvb2LSJCOeXJuMNGMXF/3az4=; b=N8oMo/vzEZdHTlMhW6uBp8o20xhLMqc+XEj7iZlw4FawWhxNSDafX+Apk0Rl9QdmTg R5gsJLNW19WakJ2wCQNsWcYzM9T5HNCFgDAfHf2htPcjRGB97kOdBC4E5otCqLjsLi4N YCMnH4UH7hLr0QVQzU1wiXGRH8qiQJr/fWGao50lWJW99X4ApCzU0uc/u4pu7heNBWqS RKLLPxrp1bUioz70OkfomtfNZNIEvpxzsYlMVlv3DLJbkf/5WWw+1DxUNOkDMjUumRJE EUqjWacupionuGLMYqdDt0ZtimKLDksXO7Wgn+Prfp3ocRjgx5ks2LgryuHpAjUoFJHf wkpA== X-Gm-Message-State: AOAM531O0rkYhDMR1VhnUKI37emynjtYZJDtrqvqKwmDlKDnpnLc3HRo 6hp/A4Z0z+dgnsOanfVEh8nFMT6fp8k= X-Received: by 2002:aca:f5d4:: with SMTP id t203mr150123oih.132.1613872450283; Sat, 20 Feb 2021 17:54:10 -0800 (PST) Received: from Davids-MacBook-Pro.local ([8.48.134.40]) by smtp.googlemail.com with ESMTPSA id g6sm2656423ooh.29.2021.02.20.17.54.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Feb 2021 17:54:09 -0800 (PST) Subject: Re: [PATCH] arp: Remove the arp_hh_ops structure To: Yejune Deng , davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210220043203.11754-1-yejune.deng@gmail.com> From: David Ahern Message-ID: <3b69191b-9bd5-9050-9126-17b4905a67e9@gmail.com> Date: Sat, 20 Feb 2021 18:54:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210220043203.11754-1-yejune.deng@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > } >