From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC1D8CA90AF for ; Wed, 13 May 2020 09:48:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC87423127 for ; Wed, 13 May 2020 09:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363296; bh=1zvD0OnGxIN8keCRL0TYLwEP8jE3c9haru81x4zAZxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DNPP+65hqTDNWnoAHdhwUS6iB753Af+23F4KPiZ+rpQoL61H4Yre9/I70bdm//iea 53RpWaeyHjbYMQhCPtcbOOHtSp+1Cz0ceeIhUNKDoUGJaWN+VCjY26P3TSY+NuJx2X +vwuYxl/vLYw0L12u+X5ha2gPd+HekHFXIRyZQ8g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732538AbgEMJsO (ORCPT ); Wed, 13 May 2020 05:48:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:46474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733017AbgEMJsL (ORCPT ); Wed, 13 May 2020 05:48:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9FC9E20769; Wed, 13 May 2020 09:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363291; bh=1zvD0OnGxIN8keCRL0TYLwEP8jE3c9haru81x4zAZxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qNrKnejjC2E0zLe97zeV3UcH2Gvpr3Blb6xF0sFJiE+u8QQsWCtXSDf3PmCFEQnW8 wI7BvNjfw1auwMWI2F2atmmu1OPzv9/hsJe684373Euy+vTwDX7qNAcmJPzisDt1MV EfGFNubfab42qf6+HnEyg6+M/KcYHFQ+hshNi36k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Ahern , Roman Mashak , "David S. Miller" Subject: [PATCH 5.4 15/90] neigh: send protocol value in neighbor create notification Date: Wed, 13 May 2020 11:44:11 +0200 Message-Id: <20200513094410.529071389@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094408.810028856@linuxfoundation.org> References: <20200513094408.810028856@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roman Mashak [ Upstream commit 38212bb31fe923d0a2c6299bd2adfbb84cddef2a ] When a new neighbor entry has been added, event is generated but it does not include protocol, because its value is assigned after the event notification routine has run, so move protocol assignment code earlier. Fixes: df9b0e30d44c ("neighbor: Add protocol attribute") Cc: David Ahern Signed-off-by: Roman Mashak Reviewed-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/neighbour.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1954,6 +1954,9 @@ static int neigh_add(struct sk_buff *skb NEIGH_UPDATE_F_OVERRIDE_ISROUTER); } + if (protocol) + neigh->protocol = protocol; + if (ndm->ndm_flags & NTF_EXT_LEARNED) flags |= NEIGH_UPDATE_F_EXT_LEARNED; @@ -1967,9 +1970,6 @@ static int neigh_add(struct sk_buff *skb err = __neigh_update(neigh, lladdr, ndm->ndm_state, flags, NETLINK_CB(skb).portid, extack); - if (protocol) - neigh->protocol = protocol; - neigh_release(neigh); out: