All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/1] neigh: send protocol value in neighbor create notification
@ 2020-05-02  1:34 Roman Mashak
  2020-05-05 17:00 ` David Ahern
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Mashak @ 2020-05-02  1:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri, dsahern, Roman Mashak

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 <dsahern@gmail.com>
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
---
 net/core/neighbour.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 39d37d0ef575..116139233d57 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1956,6 +1956,9 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 				   NEIGH_UPDATE_F_OVERRIDE_ISROUTER);
 	}
 
+	if (protocol)
+		neigh->protocol = protocol;
+
 	if (ndm->ndm_flags & NTF_EXT_LEARNED)
 		flags |= NEIGH_UPDATE_F_EXT_LEARNED;
 
@@ -1969,9 +1972,6 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 		err = __neigh_update(neigh, lladdr, ndm->ndm_state, flags,
 				     NETLINK_CB(skb).portid, extack);
 
-	if (protocol)
-		neigh->protocol = protocol;
-
 	neigh_release(neigh);
 
 out:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net 1/1] neigh: send protocol value in neighbor create notification
  2020-05-02  1:34 [PATCH net 1/1] neigh: send protocol value in neighbor create notification Roman Mashak
@ 2020-05-05 17:00 ` David Ahern
  2020-05-05 20:40   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2020-05-05 17:00 UTC (permalink / raw)
  To: Roman Mashak, davem; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri

On 5/1/20 7:34 PM, Roman Mashak wrote:
> 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 <dsahern@gmail.com>
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
> ---
>  net/core/neighbour.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 



Reviewed-by: David Ahern <dsahern@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net 1/1] neigh: send protocol value in neighbor create notification
  2020-05-05 17:00 ` David Ahern
@ 2020-05-05 20:40   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2020-05-05 20:40 UTC (permalink / raw)
  To: dsahern; +Cc: mrv, netdev, kernel, jhs, xiyou.wangcong, jiri

From: David Ahern <dsahern@gmail.com>
Date: Tue, 5 May 2020 11:00:47 -0600

> On 5/1/20 7:34 PM, Roman Mashak wrote:
>> 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 <dsahern@gmail.com>
>> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
>> ---
>>  net/core/neighbour.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Reviewed-by: David Ahern <dsahern@gmail.com>

Applied and queued up for -stable, thanks everyone.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-05 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02  1:34 [PATCH net 1/1] neigh: send protocol value in neighbor create notification Roman Mashak
2020-05-05 17:00 ` David Ahern
2020-05-05 20:40   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.