lkml.org 
[lkml]   [2020]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.6 020/118] neigh: send protocol value in neighbor create notification
    Date
    From: Roman Mashak <mrv@mojatatu.com>

    [ 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 <dsahern@gmail.com>
    Signed-off-by: Roman Mashak <mrv@mojatatu.com>
    Reviewed-by: David Ahern <dsahern@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    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:

    \
     
     \ /
      Last update: 2020-05-13 12:09    [W:5.661 / U:0.708 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site